diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2015-02-27 14:06:20 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2015-02-27 14:06:20 +0000 |
commit | ea72cf2b56576f6b5332ba3bb0d3bf35039a46f6 (patch) | |
tree | 7f6c75901e51d8911686b8bf11f46c1cf1d02133 /systemv/cupstestppd.c | |
parent | 6ee8dca8b5c75745c18a9c4ce988e93c83700a5e (diff) | |
download | cups-ea72cf2b56576f6b5332ba3bb0d3bf35039a46f6.tar.gz |
The cupstestppd program did not handle "maxsize(nnn)" entries in cupsFilter/
cupsFilter2 values (<rdar://problem/18974858>)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12536 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'systemv/cupstestppd.c')
-rw-r--r-- | systemv/cupstestppd.c | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index 7b4655eed..23982829f 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -2371,8 +2371,41 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (!warn) errors ++; + + continue; } - else if (strcmp(program, "-")) + + if (!strncmp(program, "maxsize(", 8)) + { + size_t maxsize; /* Maximum file size */ + char *ptr; /* Pointer into maxsize(nnnn) program */ + + maxsize = (size_t)strtoll(program + 8, &ptr, 10); + + if (*ptr != ')') + { + if (!warn && !errors && !verbose) + _cupsLangPuts(stdout, _(" FAIL")); + + if (verbose >= 0) + _cupsLangPrintf(stdout, + _(" %s Bad cupsFilter value \"%s\"."), + prefix, attr->value); + + if (!warn) + errors ++; + + continue; + } + + ptr ++; + while (_cups_isspace(*ptr)) + ptr ++; + + _cups_strcpy(program, ptr); + } + + if (strcmp(program, "-")) { if (program[0] == '/') snprintf(pathprog, sizeof(pathprog), "%s%s", root, program); @@ -2457,8 +2490,41 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (!warn) errors ++; + + continue; } - else if (strcmp(program, "-")) + + if (!strncmp(program, "maxsize(", 8)) + { + size_t maxsize; /* Maximum file size */ + char *ptr; /* Pointer into maxsize(nnnn) program */ + + maxsize = (size_t)strtoll(program + 8, &ptr, 10); + + if (*ptr != ')') + { + if (!warn && !errors && !verbose) + _cupsLangPuts(stdout, _(" FAIL")); + + if (verbose >= 0) + _cupsLangPrintf(stdout, + _(" %s Bad cupsFilter2 value \"%s\"."), + prefix, attr->value); + + if (!warn) + errors ++; + + continue; + } + + ptr ++; + while (_cups_isspace(*ptr)) + ptr ++; + + _cups_strcpy(program, ptr); + } + + if (strcmp(program, "-")) { if (strncmp(program, "maxsize(", 8) && (ptr = strchr(program + 8, ')')) != NULL) |