]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Bug #128: trailing spaces in PPD files.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 19 Oct 2000 02:03:24 +0000 (02:03 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 19 Oct 2000 02:03:24 +0000 (02:03 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@1415 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
cups/ppd.c

index b2cf37c752b769b4051b86835ddcd9a6b318a65a..0b893cc682d34ad49504d18be10503deafddb216 100644 (file)
@@ -29,6 +29,9 @@ CHANGES IN CUPS V1.1.5
          /dev/usb/usblp# filenames.
        - The PRINTER and LPDEST environment variables did not
          override the lpoptions default printer.
+       - The PPD read functions incorrectly included trailing
+         characters (usually whitespace) after quoted string
+         attributes.
 
 
 CHANGES IN CUPS v1.1.4
index 26493635471afa5738bfa6100c3a36434d2b78ec..0daf861f2196f3fc65a3c8bcad51392d12536163 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.46 2000/09/18 00:34:45 mike Exp $"
+ * "$Id: ppd.c,v 1.47 2000/10/19 02:03:24 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -1600,7 +1600,29 @@ ppd_read(FILE *fp,               /* I - File to read from */
        *lineptr++ = ch;
 
        if (ch == '\"')
-          endquote = !endquote;
+        {
+         endquote = !endquote;
+
+          if (!endquote)
+         {
+          /*
+           * End of quoted string; ignore trailing characters...
+           */
+
+           while ((ch = getc(fp)) != EOF)
+             if (ch == '\n')
+               break;
+             else if (ch == '\r')
+             {
+               ch = getc(fp);
+               if (ch != '\n')
+                 ungetc(ch, fp);
+               break;
+             }
+
+            break;
+         }
+       }
       }
     }
 
@@ -1861,5 +1883,5 @@ ppd_fix(char *string)             /* IO - String to fix */
 
 
 /*
- * End of "$Id: ppd.c,v 1.46 2000/09/18 00:34:45 mike Exp $".
+ * End of "$Id: ppd.c,v 1.47 2000/10/19 02:03:24 mike Exp $".
  */