/*
- * "$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).
*
* Don't allow nesting of options...
*/
- if (option)
+ if (option && ppd_conform == PPD_CONFORM_STRICT)
{
ppd_status = PPD_NESTED_OPEN_UI;
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) &&
* Don't allow nesting of options...
*/
- if (option)
+ if (option && ppd_conform == PPD_CONFORM_STRICT)
{
ppd_status = PPD_NESTED_OPEN_UI;
optptr = option;
- while (*lineptr != '\0' && *lineptr != '\n' && *lineptr != ':' &&
+ while (*lineptr != '\0' && !isspace(*lineptr) && *lineptr != ':' &&
*lineptr != '/')
{
if (*lineptr <= ' ' || *lineptr > 126 ||
*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));*/
/*
- * 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 $".
*/