_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);
/*
* '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 */
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"))
/*
* '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 */
/*
* '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. */
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) +
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"))
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"))
/*
* 'ppdSetConformance()' - Set the conformance level for PPD files.
*
- * @since CUPS 1.1.20@
+ * @since CUPS 1.1.20/Mac OS X 10.4@
*/
void
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));
}