diff options
author | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2007-03-14 16:55:44 +0000 |
---|---|---|
committer | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2007-03-14 16:55:44 +0000 |
commit | f7deaa1a21758ec90bf23314af018481ea8aea7f (patch) | |
tree | 28c1e9c935060b27e10b2e9daa788f69508f3726 /cups/file.c | |
parent | b86bc4cf571c35972a94a634ea884baff9799fa9 (diff) |
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@279 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/file.c')
-rw-r--r-- | cups/file.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/cups/file.c b/cups/file.c index b2a831157..2eac3a3cd 100644 --- a/cups/file.c +++ b/cups/file.c @@ -1,5 +1,5 @@ /* - * "$Id: file.c 6193 2007-01-10 19:27:04Z mike $" + * "$Id: file.c 6311 2007-02-27 14:43:39Z mike $" * * File functions for the Common UNIX Printing System (CUPS). * @@ -508,7 +508,7 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ */ *value = NULL; - + while (cupsFileGets(fp, buf, buflen)) { (*linenum) ++; @@ -519,15 +519,24 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ if ((ptr = strchr(buf, '#')) != NULL) { - while (ptr > buf) + if (ptr > buf && ptr[-1] == '\\') { - if (!isspace(ptr[-1] & 255)) - break; - - ptr --; + // Unquote the #... + _cups_strcpy(ptr - 1, ptr); } + else + { + // Strip the comment and any trailing whitespace... + while (ptr > buf) + { + if (!isspace(ptr[-1] & 255)) + break; + + ptr --; + } - *ptr = '\0'; + *ptr = '\0'; + } } /* @@ -2126,5 +2135,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */ /* - * End of "$Id: file.c 6193 2007-01-10 19:27:04Z mike $". + * End of "$Id: file.c 6311 2007-02-27 14:43:39Z mike $". */ |