]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The Mac OS X USB backend did not work with some printers that reported a bad
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 23 Sep 2008 20:06:53 +0000 (20:06 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 23 Sep 2008 20:06:53 +0000 (20:06 +0000)
1284 device ID.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@7973 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.3.txt
backend/usb-darwin.c

index 320e6ea3060e53e8d6298a6eecb0ad301814effb..fd1822715b73217c5127e35f24155305b515794b 100644 (file)
@@ -4,6 +4,8 @@ CHANGES-1.3.txt
 CHANGES IN CUPS V1.3.9
 
        - Documentation updates (STR #2904, STR #2944)
+       - The Mac OS X USB backend did not work with some printers
+         that reported a bad 1284 device ID.
        - The scheduler incorrectly resolved the client connection
          address when HostNameLookups was set to Off (STR #2946)
        - The IPP backend incorrectly stopped the local queue if
index e9509a12e4b66f3ae1779cc8f842a8e0654a0c5a..2ec393e068e0679246d8cf2298c86d5623979f72 100644 (file)
@@ -1036,11 +1036,13 @@ static Boolean list_device_cb(void *refcon,
 
       modelstr[0] = '/';
 
-      if (!CFStringGetCString(make, makestr, sizeof(makestr),
+      if (!make ||
+          !CFStringGetCString(make, makestr, sizeof(makestr),
                              kCFStringEncodingUTF8))
         strcpy(makestr, "Unknown");
 
-      if (!CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1,
+      if (!model ||
+          !CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1,
                              kCFStringEncodingUTF8))
         strcpy(modelstr + 1, "Printer");
 
@@ -1193,18 +1195,10 @@ static void copy_deviceinfo(CFStringRef deviceIDString,
   CFStringRef serialKeys[] = { CFSTR("SN:"),  CFSTR("SERN:"), NULL };
 
   if (make != NULL)
-  {
-    if ((*make = copy_value_for_key(deviceIDString, makeKeys)) == NULL)
-      *make = CFStringCreateWithCString(kCFAllocatorDefault, "Unknown",
-                                        kCFStringEncodingUTF8);
-  }
+    *make = copy_value_for_key(deviceIDString, makeKeys);
 
   if (model != NULL)
-  {
-    if ((*model = copy_value_for_key(deviceIDString, modelKeys)) == NULL)
-      *model = CFStringCreateWithCString(kCFAllocatorDefault, "Printer",
-                                         kCFStringEncodingUTF8);
-  }
+    *model = copy_value_for_key(deviceIDString, modelKeys);
 
   if (serial != NULL)
     *serial = copy_value_for_key(deviceIDString, serialKeys);