]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Work around broken 1284 device IDs that use a newline instead of a semicolon.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 9 Oct 2012 03:01:31 +0000 (03:01 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 9 Oct 2012 03:01:31 +0000 (03:01 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10642 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.6.txt
backend/snmp.c

index 3b308c80cdf4afe96656b59376864dea2225cc0e..b7b72b8c16ab4a633b5633245b4524c92f1cf78c 100644 (file)
@@ -4,6 +4,8 @@ CHANGES-1.6.txt
 CHANGES IN CUPS V1.6.2
 
        - Documentation fixes
+       - The SNMP backend now tries to work around broken printers that use a
+         newline to separate key/value pairs.
        - The IPP backend did not send a cancel request to printers when a job
          was canceled and the printer did not support Create-Job.
        - Fixed EPM packaging files (STR #4199)
index f672e37bafc353995aa7741b088ed0198554261a..fc40800c6190204538797d66fda2e10adba338e1 100644 (file)
@@ -1025,6 +1025,11 @@ read_snmp_response(int fd)               /* I - SNMP socket file descriptor */
            * Description is the IEEE-1284 device ID...
            */
 
+            char *ptr;                 /* Pointer into device ID */
+
+            for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++)
+              if (*ptr == '\n')
+                *ptr = ';';            /* A lot of bad printers put a newline */
            if (!device->id)
              device->id = strdup((char *)packet.object_value.string.bytes);
 
@@ -1066,8 +1071,11 @@ read_snmp_response(int fd)               /* I - SNMP socket file descriptor */
          */
 
          char  make_model[256];        /* Make and model */
+          char *ptr;                   /* Pointer into device ID */
 
-
+          for (ptr = (char *)packet.object_value.string.bytes; *ptr; ptr ++)
+            if (*ptr == '\n')
+              *ptr = ';';              /* A lot of bad printers put a newline */
          if (device->id)
            free(device->id);