]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Clean up "Kodak" manufacturer name
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 12 Oct 2021 09:23:02 +0000 (11:23 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 12 Oct 2021 09:23:02 +0000 (11:23 +0200)
Some Kodak printers/PPD files report "Eastman Kodak Company", others
simply "Kodak" as manufacturer name. Let the
ieee1284NormalizeMakeAndModel() function use simply "Kodak" here.

cupsfilters/ieee1284.c

index 9b8e49de989de5744db7b928578553111a5d40d9..ed0e52979a1762f927d80c91c4b7acbd7e0701cf 100644 (file)
@@ -1028,6 +1028,26 @@ ieee1284NormalizeMakeAndModel(
       bufptr += 2;
     }
 
+    bufptr = buffer;
+    while ((bufptr = strcasestr(bufptr, "eastman kodak company")) != NULL &&
+          (bufptr == buffer || !isalnum(*(bufptr - 1))) &&
+          !isalnum(*(bufptr + 21)))
+    {
+     /*
+      * Replace with Kodak...
+      */
+
+      bufptr[0] = 'K';
+      bufptr[1] = 'o';
+      bufptr[2] = 'd';
+      bufptr[3] = 'a';
+      bufptr[4] = 'k';
+      moverightpart(buffer, bufsize, bufptr + 5, -16);
+      if (modelptr >= bufptr + 21)
+       modelptr -= 16;
+      bufptr += 5;
+    }
+
     bufptr = buffer;
     while ((bufptr = strcasestr(bufptr, "Lexmark International")) != NULL)
     {