From: msweet Date: Mon, 26 Oct 2015 18:07:32 +0000 (+0000) Subject: Strip trailing ? and / before checking for .ppd () X-Git-Tag: v2.2b1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c26ceab0844da63b31e5e71387dd303dffa6b93b;p=thirdparty%2Fcups.git Strip trailing ? and / before checking for .ppd () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12940 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.1.txt b/CHANGES-2.1.txt index 80fb00333f..061aa83920 100644 --- a/CHANGES-2.1.txt +++ b/CHANGES-2.1.txt @@ -9,7 +9,8 @@ CHANGES IN CUPS V2.1.1 , , , , , , - , ) + , , + ) - The cupsGetPPD* functions did not work with IPP printers (STR #4725) - Some older HP LaserJet printers need a delayed close when printing using the libusb-based USB backend (STR #4549) diff --git a/scheduler/auth.c b/scheduler/auth.c index 14a224a189..7c00c65b9d 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -1492,6 +1492,12 @@ cupsdFindBest(const char *path, /* I - Resource path */ strlcpy(uri, path, sizeof(uri)); + if ((uriptr = strchr(uri, '?')) != NULL) + *uriptr = '\0'; /* Drop trailing query string */ + + if ((uriptr = uri + strlen(uri) - 1) > uri && *uriptr == '/') + *uriptr = '\0'; /* Remove trailing '/' */ + if (!strncmp(uri, "/printers/", 10) || !strncmp(uri, "/classes/", 9)) { @@ -1505,12 +1511,6 @@ cupsdFindBest(const char *path, /* I - Resource path */ *uriptr = '\0'; } - if ((uriptr = strchr(uri, '?')) != NULL) - *uriptr = '\0'; /* Drop trailing query string */ - - if ((uriptr = uri + strlen(uri) - 1) > uri && *uriptr == '/') - *uriptr = '\0'; /* Remove trailing '/' */ - /* * Loop through the list of locations to find a match... */