]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: In ieee1284NormalizeMakeAndModel() also consider " - " as separator
authorTill Kamppeter <till.kamppeter@gmail.com>
Mon, 1 Nov 2021 22:25:52 +0000 (23:25 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Mon, 1 Nov 2021 22:25:52 +0000 (23:25 +0100)
Before, ieee1284NormalizeMakeAndModel() only considered ',', ';', and
'(' as separator between printer model name and extra info (driver,
version, language, ...). Now we also consider " - " (isolated dash) as
such a separator.

cupsfilters/ieee1284.c

index 1bcbeddcc6200c5734ef105cd10a9b93b2bdd2de..a38f680008e696b6f9bb39f2a85fd4b912b9f594 100644 (file)
@@ -1167,12 +1167,13 @@ ieee1284NormalizeMakeAndModel(
     else
     {
       /* Not having a regular expression we consider comma, semicolon,
-        or parenthese as the end of the model name and the rest of
-        the string as extra info. So we set a pointer to this extra
-        info if we find such a character */
+        isolated dash, or parenthese as the end of the model name and
+        the rest of the string as extra info. So we set a pointer to
+        this extra info if we find such a character */
       if ((extraptr = strchr(buffer, ',')) == NULL)
        if ((extraptr = strchr(buffer, ';')) == NULL)
-         extraptr = strchr(buffer, '(');
+         if ((extraptr = strstr(buffer, " - ")) == NULL)
+           extraptr = strchr(buffer, '(');
       if (extraptr)
       {
        if (human)