]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libppd: Fixed PPD URIs when generating dynamic PPDs
authorTill Kamppeter <till.kamppeter@gmail.com>
Sun, 19 Sep 2021 21:39:27 +0000 (23:39 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sun, 19 Sep 2021 21:39:27 +0000 (23:39 +0200)
The PPD URIs of the PPD collection handling of libppd are not
identical with the PPD URIs of CUPS and so not identical with the PPD
URIs used by the dynamic PPD generator executables (the ones which are
in /usr/lib/cups/driver/ for CUPS). The difference is in the scheme,
the part before the colon. The schemes for the dynamic PPD generator
did not get extracted correctly. Most dynamic PPD generatores do not
use the scheme internally and therefore work also with the scheme
corrupted, like pyppd or HPLIP, but Gutenprint does not, as it checks
the version by the scheme,

This commit fixes the extraction of the scheme and so all dynamic PPD
generators should work now.

ppd/ppd-collection.c

index 82953b2f59dece1c3a880479737353926c61da09..b1734dd853860fcb03392b135318f2212474af48 100644 (file)
@@ -724,7 +724,9 @@ ppdCollectionGetPPD(
     ptr = strrchr(realname, '/');
     if (ptr == NULL)
       ptr = realname;
-    ptr = strstr(ppduri, ptr);
+    else
+      ptr ++;
+    ptr = ppduri + (ptr - realname);
     if (access(realname, X_OK))
     {
      /*
@@ -741,6 +743,9 @@ ppdCollectionGetPPD(
    /*
     * Yes, let it cat the PPD file...
     */
+    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+                "libppd: [PPD Collections] Grabbing PPD via command: \"%s cat %s\"",
+                realname, ptr);
 
     argv[0] = realname;
     argv[1] = (char *)"cat";