]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: Let colord_get_profile_for_device_id() not return empty file name
authorTill Kamppeter <till.kamppeter@gmail.com>
Sun, 19 Sep 2021 17:53:30 +0000 (19:53 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sun, 19 Sep 2021 17:53:30 +0000 (19:53 +0200)
If the function colord_get_profile_for_device_id() returns an empty
file name, the color generates an error message in the CUPS
error_log. Some print dialogs report every log message of level error
to the user even if the job got correctly printed.

NEWS
cupsfilters/colord.c

diff --git a/NEWS b/NEWS
index 1cbff93fd9153ae8b94d30fdf89355e62bd4aa6d..dc683a43d454aa7cc531083147e08915b5f81772 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ NEWS - OpenPrinting CUPS Filters v1.28.10 - 2021-08-17
 
 CHANGES IN V1.28.11
 
+       - libcupsfilters: Let colord_get_profile_for_device_id() not
+         return empty file name, to avoid error messages in CUPS
+         error_log.
        - foomatic-rip: Debug message was wrongly sent to stdout and
          not to log (Issue #422).
 
index ad2f55c9d18994aed99dbe73dcb6b9efa4b86e89..aedaedd17a8b845a5a0d648ef7b01e00caac73d1 100644 (file)
@@ -327,7 +327,7 @@ colord_get_profile_for_device_id (const char *device_id,
   con = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
   if (con == NULL) {
     // If D-Bus is not reachable, gracefully leave and ignore error
-    //fprintf(stderr, "ERROR: Failed to connect to system bus\n");
+    fprintf(stderr, "DEBUG: Failed to connect to system bus\n");
     goto out;
   }
 
@@ -340,7 +340,7 @@ colord_get_profile_for_device_id (const char *device_id,
 
   /* get the best profile for the device */
   filename = get_profile_for_device_path(con, device_path, qualifier_tuple);
-  if (filename == NULL) {
+  if (filename == NULL || !filename[0]) {
     fprintf(stderr, "DEBUG: Failed to get profile filename for %s\n", device_id);
     goto out;
   }