]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdmerge.cxx
Sync up changelog.
[thirdparty/cups.git] / ppdc / ppdmerge.cxx
index 923355c09cb35642643cdd1a9400bf3665c21354..8c4863e11f2625513caeea022e0903e0a76954b6 100644 (file)
@@ -1,22 +1,16 @@
 //
 // "$Id$"
 //
-//   PPD file merge utility for the CUPS PPD Compiler.
+// PPD file merge utility for the CUPS PPD Compiler.
 //
-//   Copyright 2007-2011 by Apple Inc.
-//   Copyright 2002-2007 by Easy Software Products.
+// Copyright 2007-2014 by Apple Inc.
+// Copyright 2002-2007 by Easy Software Products.
 //
-//   These coded instructions, statements, and computer programs are the
-//   property of Apple Inc. and are protected by Federal copyright
-//   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-//   which should have been included with this file.  If this file is
-//   file is missing or damaged, see the license at "http://www.cups.org/".
-//
-// Contents:
-//
-//   main()       - Main entry for the PPD merge utility.
-//   ppd_locale() - Return the locale associated with a PPD file.
-//   usage()      - Show usage and exit.
+// These coded instructions, statements, and computer programs are the
+// property of Apple Inc. and are protected by Federal copyright
+// law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+// which should have been included with this file.  If this file is
+// file is missing or damaged, see the license at "http://www.cups.org/".
 //
 
 //
@@ -104,18 +98,18 @@ main(int  argc,                            // I - Number of command-line arguments
         ppd_status_t   status;         // PPD open status
        int             curline,        // Current line
                        linenum;        // Line number
-       
-       
+
+
         status = ppdLastError(&linenum);
-       
+
        _cupsLangPrintf(stderr,
                        _("%s: Unable to open PPD file: %s on line %d."),
                        "ppdmerge", ppdErrorString(status), linenum);
         cupsFileRewind(infile);
-       
+
         line[0] = '\0';
        curline = 0;
-       
+
         while (cupsFileGets(infile, line, sizeof(line)))
        {
          curline ++;
@@ -128,7 +122,7 @@ main(int  argc,                             // I - Number of command-line arguments
         cupsFileClose(infile);
        return (1);
       }
-      
+
       // Figure out the locale...
       if ((locale = ppd_locale(ppd)) == NULL)
       {
@@ -147,13 +141,13 @@ main(int  argc,                           // I - Number of command-line arguments
        languages = _ppdGetLanguages(ppd);
 
         if (outname && !strcmp(inname, outname))
-       {       
+       {
          // Rename input filename so that we don't overwrite it...
          char bckname[1024];           // Backup filename
-         
-         
+
+
          snprintf(bckname, sizeof(bckname), "%s.bck", inname);
-         
+
          if (rename(inname, bckname))
          {
            _cupsLangPrintf(stderr,
@@ -177,7 +171,7 @@ main(int  argc,                             // I - Number of command-line arguments
                        argv[i]);
         ppdClose(ppd);
       }
-      
+
       // Close and move on...
       cupsFileClose(infile);
     }
@@ -302,8 +296,8 @@ main(int  argc,                             // I - Number of command-line arguments
 static const char *                    // O - Locale string
 ppd_locale(ppd_file_t *ppd)            // I - PPD file
 {
-  int          i,                      // Looping var
-               vlen;                   // Length of LanguageVersion string
+  int          i;                      // Looping var
+  size_t       vlen;                   // Length of LanguageVersion string
   static char  locale[255];            // Locale string
   static struct                                // LanguageVersion translation table
   {
@@ -341,7 +335,7 @@ ppd_locale(ppd_file_t *ppd)         // I - PPD file
   {
     vlen = strlen(languages[i].version);
 
-    if (!strncasecmp(ppd->lang_version, languages[i].version, vlen))
+    if (!_cups_strncasecmp(ppd->lang_version, languages[i].version, vlen))
     {
       if (ppd->lang_version[vlen] == '-' ||
           ppd->lang_version[vlen] == '_')