From: mike Date: Thu, 14 Jan 2010 21:57:47 +0000 (+0000) Subject: The PPD compiler did not correctly add the manufacturer to the output filename X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9c5ba494924d77cda3abcacd7aaff44850a653c;p=thirdparty%2Fcups.git The PPD compiler did not correctly add the manufacturer to the output filename when using the "-m" option (STR #3469) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@8944 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.4.txt b/CHANGES-1.4.txt index 9971031a6d..744d6364a0 100644 --- a/CHANGES-1.4.txt +++ b/CHANGES-1.4.txt @@ -7,6 +7,8 @@ CHANGES IN CUPS V1.4.3 connection, leading to a crash (STR #3200) - Localization updates (STR #3352, STR #3409, STR #3422) - Documentation update (STR #3451) + - The PPD compiler did not correctly add the manufacturer to the output + filename when using the "-m" option (STR #3469) - The IPP backend did not handle authentication properly for the Get- Printer-Attributes operation (STR 3458) - Getting SNMP values larger than 127 bytes did not work. diff --git a/backend/ipp.c b/backend/ipp.c index 5f976c6ba7..213de1ae42 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -3,7 +3,7 @@ * * IPP backend for the Common UNIX Printing System (CUPS). * - * Copyright 2007-2009 by Apple Inc. + * Copyright 2007-2010 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the diff --git a/ppdc/ppdc-source.cxx b/ppdc/ppdc-source.cxx index 5069a87770..3b21153471 100644 --- a/ppdc/ppdc-source.cxx +++ b/ppdc/ppdc-source.cxx @@ -3,7 +3,7 @@ // // Source class for the CUPS PPD Compiler. // -// Copyright 2007-2009 by Apple Inc. +// Copyright 2007-2010 by Apple Inc. // Copyright 2002-2007 by Easy Software Products. // // These coded instructions, statements, and computer programs are the @@ -3514,7 +3514,8 @@ ppdcSource::write_file(const char *f) // I - File to write for (d = (ppdcDriver *)drivers->first(); d; d = (ppdcDriver *)drivers->next()) { // Start the driver... - cupsFilePrintf(fp, "\n// %s %s\n", d->manufacturer->value, d->model_name->value); + cupsFilePrintf(fp, "\n// %s %s\n", d->manufacturer->value, + d->model_name->value); cupsFilePuts(fp, "{\n"); // Write the copyright stings... diff --git a/ppdc/ppdc.cxx b/ppdc/ppdc.cxx index fbc54378f1..78ad95f94c 100644 --- a/ppdc/ppdc.cxx +++ b/ppdc/ppdc.cxx @@ -3,7 +3,7 @@ // // PPD file compiler main entry for the CUPS PPD Compiler. // -// Copyright 2007-2008 by Apple Inc. +// Copyright 2007-2010 by Apple Inc. // Copyright 2002-2007 by Easy Software Products. // // These coded instructions, statements, and computer programs are the @@ -52,6 +52,8 @@ main(int argc, // I - Number of command-line arguments char *opt, // Current option *value, // Value in option *outname, // Output filename + make_model[1024], + // Make and model pcfilename[1024], // Lowercase pcfilename filename[1024]; // PPD filename @@ -313,7 +315,21 @@ main(int argc, // I - Number of command-line arguments { // Write the PPD file for this driver... if (use_model_name) - outname = d->model_name->value; + { + if (!strncasecmp(d->model_name->value, d->manufacturer->value, + strlen(d->manufacturer->value))) + { + // Model name already starts with the manufacturer... + outname = d->model_name->value; + } + else + { + // Add manufacturer to the front of the model name... + snprintf(make_model, sizeof(make_model), "%s %s", + d->manufacturer->value, d->model_name->value); + outname = make_model; + } + } else if (d->file_name) outname = d->file_name->value; else