From: msweet Date: Wed, 28 Jan 2015 16:21:40 +0000 (+0000) Subject: Mapping of PPD keywords to IPP keywords did not work if the PPD keyword was X-Git-Tag: v2.2b1~377 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79d7d84abfe27c9c8b7e622e0fda0d42244387dd;p=thirdparty%2Fcups.git Mapping of PPD keywords to IPP keywords did not work if the PPD keyword was already an IPP keyword () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12432 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.0.txt b/CHANGES-2.0.txt index d3930abe6f..5ff4ac0291 100644 --- a/CHANGES-2.0.txt +++ b/CHANGES-2.0.txt @@ -22,6 +22,8 @@ CHANGES IN CUPS V2.0.2 - The --without-xinetd configure option did not work (STR #4542) - Backends needing to load OS X kernel extensions did not work () + - Mapping of PPD keywords to IPP keywords did not work if the PPD + keyword was already an IPP keyword () CHANGES IN CUPS V2.0.1 diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 510bb5f9f5..ddccfb93fe 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -3,7 +3,7 @@ * * PPD cache implementation for CUPS. * - * Copyright 2010-2014 by Apple Inc. + * Copyright 2010-2015 by Apple Inc. * * These coded instructions, statements, and computer programs are the * property of Apple Inc. and are protected by Federal copyright @@ -2691,6 +2691,25 @@ pwg_unppdize_name(const char *ppd, /* I - PPD keyword */ *end; /* End of name buffer */ + if (_cups_islower(*ppd)) + { + /* + * Already lowercase name, use as-is? + */ + + const char *ppdptr; /* Pointer into PPD keyword */ + + for (ppdptr = ppd + 1; *ppdptr; ppdptr ++) + if (_cups_isupper(*ppdptr) || strchr(dashchars, *ppdptr)) + break; + + if (!*ppdptr) + { + strlcpy(name, ppd, namesize); + return; + } + } + for (ptr = name, end = name + namesize - 1; *ppd && ptr < end; ppd ++) { if (_cups_isalnum(*ppd) || *ppd == '-')