diff options
author | Vincent Untz <vuntz@novell.com> | 2008-11-20 23:23:07 +0100 |
---|---|---|
committer | Vincent Untz <vuntz@novell.com> | 2008-11-20 23:23:07 +0100 |
commit | dcd1731d6f017664224db217475b0b6fbac3118b (patch) | |
tree | 10af253704f2bccd65bc8b855db60b439317dd14 | |
parent | b4d43606c097be18c54b504346f8eb475757de9a (diff) |
Fix a bug where most of the changes to a printer didn't work.
A lot of changes are done by sending a new PPD file. And it didn't work
because we were sending it with an empty URI (instead of no URI).
-rw-r--r-- | src/cups.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -738,8 +738,14 @@ cph_cups_printer_add_with_ppd_file (CphCups *cups, ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_NAME, "printer-name", NULL, printer_name); - ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_URI, - "device-uri", NULL, printer_uri); + + /* In this specific case of ADD_MODIFY, the URI can be NULL/empty since + * we provide a complete PPD. And cups fails if we pass an empty + * string. */ + if (printer_uri && printer_uri[0] != '\0') { + ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_URI, + "device-uri", NULL, printer_uri); + } if (info && info[0] != '\0') { ippAddString (request, IPP_TAG_PRINTER, IPP_TAG_TEXT, |