]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The PPD compiler did not correctly add the manufacturer to the output filename
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 14 Jan 2010 21:57:47 +0000 (21:57 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 14 Jan 2010 21:57:47 +0000 (21:57 +0000)
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

CHANGES-1.4.txt
backend/ipp.c
ppdc/ppdc-source.cxx
ppdc/ppdc.cxx

index 9971031a6d2324c269460d5a36abb7b4067e43a6..744d6364a00af705e96c71248be1f40cae2f6e90 100644 (file)
@@ -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.
index 5f976c6ba78ef604662f0c2e53c0b5e83202ebe0..213de1ae42a5ba78fe9251d40434490e407b3447 100644 (file)
@@ -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
index 5069a877704565288d18a912d85ee2e921d9dbe2..3b211534715960bd79003540e36a2564753d632f 100644 (file)
@@ -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...
index fbc54378f132485cc5c9e91aabbd5954d35e3e70..78ad95f94c8044d23ad3cfab84a7183c4e09a1a2 100644 (file)
@@ -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