cups/cups-dnssd-deviceid.patch

39 lines
1.5 KiB
Diff
Raw Normal View History

diff -up cups-2.1.4/backend/dnssd.c.dnssd-deviceid cups-2.1.4/backend/dnssd.c
--- cups-2.1.4/backend/dnssd.c.dnssd-deviceid 2016-06-15 14:36:19.922353606 +0200
+++ cups-2.1.4/backend/dnssd.c 2016-06-15 14:45:45.794966648 +0200
@@ -1188,15 +1188,22 @@ query_callback(
2012-08-08 11:28:28 +00:00
if (device->device_id)
free(device->device_id);
+if (device_id[0])
+{
+ /* Mark this as the real device ID. */
+ ptr = device_id + strlen(device_id);
+ snprintf(ptr, sizeof(device_id) - (ptr - device_id), "FZY:0;");
+}
+
2012-08-08 11:28:28 +00:00
if (!device_id[0] && strcmp(model, "Unknown"))
{
if (make_and_model[0])
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
make_and_model, model);
else if (!_cups_strncasecmp(model, "designjet ", 10))
- snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;", model + 10);
2012-08-08 11:28:28 +00:00
+ snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;FZY:1;", model + 10);
else if (!_cups_strncasecmp(model, "stylus ", 7))
- snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;", model + 7);
2012-08-08 11:28:28 +00:00
+ snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;FZY:1;", model + 7);
else if ((ptr = strchr(model, ' ')) != NULL)
{
/*
@@ -1206,7 +1213,7 @@ query_callback(
2014-09-12 16:19:24 +00:00
memcpy(make_and_model, model, (size_t)(ptr - model));
2012-08-08 11:28:28 +00:00
make_and_model[ptr - model] = '\0';
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
2012-08-08 11:28:28 +00:00
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
make_and_model, ptr + 1);
}
}