diff options
Diffstat (limited to 'cups/testppd.c')
-rw-r--r-- | cups/testppd.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cups/testppd.c b/cups/testppd.c index 5e291ce83..ef88425dc 100644 --- a/cups/testppd.c +++ b/cups/testppd.c @@ -3,7 +3,7 @@ * * PPD test program for CUPS. * - * Copyright 2007-2011 by Apple Inc. + * Copyright 2007-2012 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -150,6 +150,7 @@ main(int argc, /* I - Number of command-line arguments */ maxsize, /* Maximum size */ *size; /* Current size */ ppd_attr_t *attr; /* Current attribute */ + _ppd_cache_t *pc; /* PPD cache */ status = 0; @@ -897,7 +898,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((realsize = readlink(filename, realfile, sizeof(realfile) - 1)) < 0) - strcpy(realfile, "Unknown"); + strlcpy(realfile, "Unknown", sizeof(realfile)); else realfile[realsize] = '\0'; @@ -1073,6 +1074,15 @@ main(int argc, /* I - Number of command-line arguments */ attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs)) printf(" *%s %s/%s: \"%s\"\n", attr->name, attr->spec, attr->text, attr->value ? attr->value : ""); + + puts("\nPPD Cache:"); + if ((pc = _ppdCacheCreateWithPPD(ppd)) == NULL) + printf(" Unable to create: %s\n", cupsLastErrorString()); + else + { + _ppdCacheWriteFile(pc, "t.cache", NULL); + puts(" Wrote t.cache."); + } } if (!strncmp(argv[1], "-d", 2)) |