]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge relevant portion of _cupsGet1284Values changes in OpenPrinting (Issue #5972)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 1 Oct 2021 15:12:13 +0000 (11:12 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 1 Oct 2021 15:12:13 +0000 (11:12 -0400)
cups/options.c

index 11814c9af256d8796016e14f1d27659dea7b160f..e45858c2c9e9c7f879d432c9d872c490e052c730 100644 (file)
@@ -603,16 +603,15 @@ _cupsGet1284Values(
       if (ptr < (value + sizeof(value) - 1))
         *ptr++ = *device_id;
 
-    if (!*device_id)
-      break;
-
     while (ptr > value && _cups_isspace(ptr[-1]))
       ptr --;
 
     *ptr = '\0';
-    device_id ++;
-
     num_values = cupsAddOption(key, value, num_values, values);
+         
+    if (!*device_id)
+      break;
+    device_id ++;
   }
 
   return (num_values);