replace ' with _ as well
authorAndrew Tridgell <tridge@samba.org>
Mon, 23 Nov 1998 03:46:51 +0000 (03:46 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 23 Nov 1998 03:46:51 +0000 (03:46 +0000)
source/lib/util_str.c
source/printing/printing.c

index dad0e854770f7d52298cbd353d187bf877660b16..5935533ceebe7ad3347ffc93231b6155231780fb 100644 (file)
@@ -998,7 +998,7 @@ enough room!
 This routine looks for pattern in s and replaces it with 
 insert. It may do multiple replacements.
 
 This routine looks for pattern in s and replaces it with 
 insert. It may do multiple replacements.
 
-any of " ; or ` in the insert string are replaced with _
+any of " ; or ` in the insert string are replaced with _
 ****************************************************************************/
 void string_sub(char *s,const char *pattern,const char *insert)
 {
 ****************************************************************************/
 void string_sub(char *s,const char *pattern,const char *insert)
 {
@@ -1019,6 +1019,7 @@ void string_sub(char *s,const char *pattern,const char *insert)
                        switch (insert[i]) {
                        case '`':
                        case '"':
                        switch (insert[i]) {
                        case '`':
                        case '"':
+                       case '\'':
                        case ';':
                                p[i] = '_';
                                break;
                        case ';':
                                p[i] = '_';
                                break;
index dfb87dc6fadcf280c73d2ce7b0c93bd9139e547d..87be54618b084a9657b2510a3233c258d4885dca 100644 (file)
@@ -411,8 +411,8 @@ static BOOL parse_lpq_aix(char *line,print_queue_struct *buf,BOOL first)
 
   /* handle the case of "(standard input)" as a filename */
   string_sub(line,"standard input","STDIN");
 
   /* handle the case of "(standard input)" as a filename */
   string_sub(line,"standard input","STDIN");
-  string_sub(line,"(","\"");
-  string_sub(line,")","\"");
+  all_string_sub(line,"(","\"");
+  all_string_sub(line,")","\"");
 
   for (count=0; 
        count<10 && 
 
   for (count=0; 
        count<10 && 
@@ -528,8 +528,8 @@ static BOOL parse_lpq_hpux(char * line, print_queue_struct *buf, BOOL first)
     if (!header_line_ok) return (False); /* incorrect header line */
     /* handle the case of "(standard input)" as a filename */
     string_sub(line,"standard input","STDIN");
     if (!header_line_ok) return (False); /* incorrect header line */
     /* handle the case of "(standard input)" as a filename */
     string_sub(line,"standard input","STDIN");
-    string_sub(line,"(","\"");
-    string_sub(line,")","\"");
+    all_string_sub(line,"(","\"");
+    all_string_sub(line,")","\"");
     
     for (count=0; count<2 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
     /* we must get 2 tokens */
     
     for (count=0; count<2 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
     /* we must get 2 tokens */
@@ -666,18 +666,18 @@ static BOOL parse_lpq_qnx(char *line,print_queue_struct *buf,BOOL first)
   fstring tok[7];
   int count=0;
 
   fstring tok[7];
   int count=0;
 
-  DEBUG(0,("antes [%s]\n", line));
+  DEBUG(4,("antes [%s]\n", line));
 
   /* handle the case of "-- standard input --" as a filename */
   string_sub(line,"standard input","STDIN");
 
   /* handle the case of "-- standard input --" as a filename */
   string_sub(line,"standard input","STDIN");
-  DEBUG(0,("despues [%s]\n", line));
-  string_sub(line,"-- ","\"");
-  string_sub(line," --","\"");
-  DEBUG(0,("despues 1 [%s]\n", line));
+  DEBUG(4,("despues [%s]\n", line));
+  all_string_sub(line,"-- ","\"");
+  all_string_sub(line," --","\"");
+  DEBUG(4,("despues 1 [%s]\n", line));
 
   string_sub(line,"[job #","");
   string_sub(line,"]","");
 
   string_sub(line,"[job #","");
   string_sub(line,"]","");
-  DEBUG(0,("despues 2 [%s]\n", line));
+  DEBUG(4,("despues 2 [%s]\n", line));
 
   
   
 
   
   
@@ -733,8 +733,8 @@ static BOOL parse_lpq_plp(char *line,print_queue_struct *buf,BOOL first)
 
   /* handle the case of "(standard input)" as a filename */
   string_sub(line,"stdin","STDIN");
 
   /* handle the case of "(standard input)" as a filename */
   string_sub(line,"stdin","STDIN");
-  string_sub(line,"(","\"");
-  string_sub(line,")","\"");
+  all_string_sub(line,"(","\"");
+  all_string_sub(line,")","\"");
   
   for (count=0; count<11 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
 
   
   for (count=0; count<11 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;