From: mike Date: Tue, 23 Sep 2008 20:06:53 +0000 (+0000) Subject: The Mac OS X USB backend did not work with some printers that reported a bad X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fcbb25883f9d14ba7ee08432cf78517f254134b7;p=thirdparty%2Fcups.git The Mac OS X USB backend did not work with some printers that reported a bad 1284 device ID. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@7973 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt index 320e6ea306..fd1822715b 100644 --- a/CHANGES-1.3.txt +++ b/CHANGES-1.3.txt @@ -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 diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index e9509a12e4..2ec393e068 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -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);