--- orig/cups-1.5.0/backend/usb-libusb.c 2011-11-01 02:28:20.000000000 +0100 +++ cups-1.5.0/backend/usb-libusb.c 2011-11-02 00:54:05.000000000 +0100 @@ -339,9 +339,11 @@ * 1284.4 (packet mode) protocol as well. */ - if (altptr->bInterfaceClass != USB_CLASS_PRINTER || - altptr->bInterfaceSubClass != 1 || - (altptr->bInterfaceProtocol != 1 && /* Unidirectional */ + if (( altptr->bInterfaceClass != USB_CLASS_PRINTER || altptr->bInterfaceSubClass != 1 ) && + /* Ugly patch for Epson Receipt Printer M129C */ + ( device->descriptor.idVendor != 0x04b8 && device->descriptor.idProduct != 0x0202 ) ) + continue; + if ((altptr->bInterfaceProtocol != 1 && /* Unidirectional */ altptr->bInterfaceProtocol != 2) || /* Bidirectional */ altptr->bInterfaceProtocol < protocol) continue; @@ -383,8 +385,7 @@ if (!open_device(&printer, data != NULL)) { - if (!get_device_id(&printer, device_id, sizeof(device_id))) - { + get_device_id(&printer, device_id, sizeof(device_id)); make_device_uri(&printer, device_id, device_uri, sizeof(device_uri)); @@ -402,7 +403,6 @@ bEndpointAddress; return (&printer); } - } close_device(&printer); } @@ -609,7 +609,7 @@ mfglen = strlen(mfg); - if (!strncasecmp(mdl, mfg, mfglen) && _cups_isspace(mdl[mfglen])) + if ( mdl && !strncasecmp(mdl, mfg, mfglen) && _cups_isspace(mdl[mfglen])) { mdl += mfglen + 1;