/*
- * "$Id: ppd.c,v 1.82 2003/01/29 17:03:37 mike Exp $"
+ * "$Id: ppd.c,v 1.83 2003/02/13 21:02:29 mike Exp $"
*
* PPD file routines for the Common UNIX Printing System (CUPS).
*
* ppd_compare_options() - Compare two options.
* ppd_decode() - Decode a string value...
* ppd_fix() - Fix WinANSI characters in the range 0x80 to
- & 0x9f to be valid ISO-8859-1 characters...
+ * 0x9f to be valid ISO-8859-1 characters...
* ppd_free_group() - Free a single UI group.
* ppd_free_option() - Free a single option.
* ppd_get_group() - Find or create the named group as needed.
static ppd_status_t ppd_status = PPD_OK;
/* Status of last ppdOpen*() */
-static int ppd_line = 1; /* Current line number */
+static int ppd_line = 0; /* Current line number */
/*
*/
ppd_status = PPD_OK;
- ppd_line = 1;
+ ppd_line = 0;
/*
* Range check input...
/*
- * Set the line number to 1...
+ * Set the line number to 0...
*/
- ppd_line = 1;
+ ppd_line = 0;
/*
* Range check input...
/*
- * Set the line number to 1...
+ * Set the line number to 0...
*/
- ppd_line = 1;
+ ppd_line = 0;
/*
* Range check input...
*/
while ((ch = getc(fp)) != EOF)
- if (ch == '\n')
- break;
- else if (ch == '\r')
+ if (ch == '\r' || ch == '\n')
{
- ch = getc(fp);
- if (ch != '\n')
- ungetc(ch, fp);
+ ppd_line ++;
- ch = '\n';
- break;
+ if (ch == '\r')
+ {
+ ch = getc(fp);
+ if (ch != '\n')
+ ungetc(ch, fp);
+
+ ch = '\n';
+ break;
+ }
}
break;
* Line feed or carriage return...
*/
+ ppd_line ++;
+
if (ch == '\r')
{
/*
/*
- * End of "$Id: ppd.c,v 1.82 2003/01/29 17:03:37 mike Exp $".
+ * End of "$Id: ppd.c,v 1.83 2003/02/13 21:02:29 mike Exp $".
*/