]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd.c
Merge changes from CUPS 1.4svn-r8329.
[thirdparty/cups.git] / cups / ppd.c
index 01eae8d82f6b017030c985a0e919539d1661ea81..c42d36d48f5cfb8008e48bfb7fc6eee7e06e76be 100644 (file)
@@ -161,7 +161,8 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
 
   _cupsStrFree(ppd->lang_encoding);
   _cupsStrFree(ppd->nickname);
-  _cupsStrFree(ppd->patches);
+  if (ppd->patches)
+    free(ppd->patches);
   _cupsStrFree(ppd->jcl_begin);
   _cupsStrFree(ppd->jcl_end);
   _cupsStrFree(ppd->jcl_ps);
@@ -323,7 +324,7 @@ ppdClose(ppd_file_t *ppd)           /* I - PPD file record */
 /*
  * 'ppdErrorString()' - Returns the text assocated with a status.
  *
- * @since CUPS 1.1.19@
+ * @since CUPS 1.1.19/Mac OS X 10.3@
  */
 
 const char *                           /* O - Status string */
@@ -377,7 +378,7 @@ _ppdGetEncoding(const char *name)   /* I - LanguageEncoding string */
   else if (!strcasecmp(name, "ISOLatin5"))
     return (CUPS_ISO8859_5);
   else if (!strcasecmp(name, "JIS83-RKSJ"))
-    return (CUPS_WINDOWS_932);
+    return (CUPS_JIS_X0213);
   else if (!strcasecmp(name, "MacStandard"))
     return (CUPS_MAC_ROMAN);
   else if (!strcasecmp(name, "WindowsANSI"))
@@ -390,7 +391,7 @@ _ppdGetEncoding(const char *name)   /* I - LanguageEncoding string */
 /*
  * 'ppdLastError()' - Return the status from the last ppdOpen*().
  *
- * @since CUPS 1.1.19@
+ * @since CUPS 1.1.19/Mac OS X 10.3@
  */
 
 ppd_status_t                           /* O - Status code */
@@ -444,7 +445,7 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
 /*
  * 'ppdOpen2()' - Read a PPD file into memory.
  *
- * @since CUPS 1.2@
+ * @since CUPS 1.2/Mac OS X 10.5@
  */
 
 ppd_file_t *                           /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
@@ -1174,7 +1175,7 @@ ppdOpen2(cups_file_t *fp)         /* I - File to read from */
     else if (!strcmp(keyword, "JobPatchFile"))
     {
       if (ppd->patches == NULL)
-        ppd->patches = _cupsStrAlloc(string);
+        ppd->patches = strdup(string);
       else
       {
         temp = realloc(ppd->patches, strlen(ppd->patches) +
@@ -1321,7 +1322,7 @@ ppdOpen2(cups_file_t *fp)         /* I - File to read from */
        strlcpy(choice->text,
                custom_attr->text[0] ? custom_attr->text : _("Custom"),
                sizeof(choice->text));
-        choice->code = _cupsStrAlloc(custom_attr->value);
+        choice->code = _cupsStrRetain(custom_attr->value);
       }
     }
     else if (!strcmp(keyword, "JCLOpenUI"))
@@ -1424,7 +1425,7 @@ ppdOpen2(cups_file_t *fp)         /* I - File to read from */
        strlcpy(choice->text,
                custom_attr->text[0] ? custom_attr->text : _("Custom"),
                sizeof(choice->text));
-        choice->code = _cupsStrAlloc(custom_attr->value);
+        choice->code = _cupsStrRetain(custom_attr->value);
       }
     }
     else if (!strcmp(keyword, "CloseUI") || !strcmp(keyword, "JCLCloseUI"))
@@ -2073,7 +2074,7 @@ ppdOpenFile(const char *filename) /* I - File to read from */
 /*
  * 'ppdSetConformance()' - Set the conformance level for PPD files.
  *
- * @since CUPS 1.1.20@
+ * @since CUPS 1.1.20/Mac OS X 10.4@
  */
 
 void
@@ -2231,13 +2232,7 @@ static int                               /* O - Result of comparison */
 ppd_compare_attrs(ppd_attr_t *a,       /* I - First attribute */
                   ppd_attr_t *b)       /* I - Second attribute */
 {
-  int  ret;                            /* Result of comparison */
-
-
-  if ((ret = strcasecmp(a->name, b->name)) != 0)
-    return (ret);
-  else
-    return (strcasecmp(a->spec, b->spec));
+  return (strcasecmp(a->name, b->name));
 }