]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 2 Aug 2003 01:04:17 +0000 (01:04 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 2 Aug 2003 01:04:17 +0000 (01:04 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3852 7a7537e8-13f0-0310-91df-b6672ffda945

cups/ppd.c

index 3737c249debd2ddfc207662b9003a9325fe89ce7..16401464a49270272ba4660232c54d7e0bfe4b0d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.51.2.57 2003/08/01 15:00:28 mike Exp $"
+ * "$Id: ppd.c,v 1.51.2.58 2003/08/02 01:04:17 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -987,7 +987,7 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
       * Don't allow nesting of options...
       */
 
-      if (option)
+      if (option && ppd_conform == PPD_CONFORM_STRICT)
       {
         ppd_status = PPD_NESTED_OPEN_UI;
 
@@ -1054,12 +1054,14 @@ ppdOpen(FILE *fp)                       /* I - File to read from */
         option->ui = PPD_UI_BOOLEAN;
       else if (string && strcmp(string, "PickOne") == 0)
         option->ui = PPD_UI_PICKONE;
-      else
+      else if (ppd_conform == PPD_CONFORM_STRICT)
       {
         ppd_status = PPD_BAD_OPEN_UI;
 
        goto error;
       }
+      else
+        option->ui = PPD_UI_PICKONE;
 
       for (j = 0; j < ppd->num_attrs; j ++)
        if (!strncmp(ppd->attrs[j]->name, "Default", 7) &&
@@ -1110,7 +1112,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       * Don't allow nesting of options...
       */
 
-      if (option)
+      if (option && ppd_conform == PPD_CONFORM_STRICT)
       {
         ppd_status = PPD_NESTED_OPEN_UI;
 
@@ -2892,7 +2894,7 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
       optptr = option;
 
-      while (*lineptr != '\0' && *lineptr != '\n' && *lineptr != ':' &&
+      while (*lineptr != '\0' && !isspace(*lineptr) && *lineptr != ':' &&
              *lineptr != '/')
       {
        if (*lineptr <= ' ' || *lineptr > 126 ||
@@ -2907,12 +2909,15 @@ ppd_read(FILE *fp,                      /* I - File to read from */
 
       *optptr = '\0';
 
-      if (!option[0] && ppd_conform == PPD_CONFORM_STRICT)
+      if (isspace(*lineptr) && ppd_conform == PPD_CONFORM_STRICT)
       {
         ppd_status = PPD_ILLEGAL_WHITESPACE;
        return (0);
       }
 
+      while (isspace(*lineptr))
+       lineptr ++;
+
       mask |= PPD_OPTION;
 
 /*      DEBUG_printf(("option = \"%s\", lineptr = \"%s\"\n", option, lineptr));*/
@@ -3002,5 +3007,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.51.2.57 2003/08/01 15:00:28 mike Exp $".
+ * End of "$Id: ppd.c,v 1.51.2.58 2003/08/02 01:04:17 mike Exp $".
  */