]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: In ieee1284NormalizeMakeAndModel() remove "series" from model
authorTill Kamppeter <till.kamppeter@gmail.com>
Sat, 6 Nov 2021 16:18:24 +0000 (17:18 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sat, 6 Nov 2021 16:18:24 +0000 (17:18 +0100)
We remove "series" from the model names when normalizing now, so we
also get a match if the printer list entry has "series" but the search
term not, or vice-versa (when both printer list enries and search
terms are normalized).

cupsfilters/ieee1284.c

index a38f680008e696b6f9bb39f2a85fd4b912b9f594..4b39d99ded19a6978a5899d7b9487463085cdf4d 100644 (file)
@@ -1120,6 +1120,20 @@ ieee1284NormalizeMakeAndModel(
     while (strncasecmp(buffer, modelptr, modelptr - buffer) == 0)
       moverightpart(buffer, bufsize, modelptr, buffer - modelptr);
 
+   /*
+    * Clean up the model name...
+    */
+
+    bufptr = modelptr;
+    while ((bufptr = strcasestr(bufptr, " series")) != NULL)
+    {
+     /*
+      * Strip "series"...
+      */
+
+      moverightpart(buffer, bufsize, bufptr, -7);
+    }
+
    /*
     * Find extra info...
     */