Breakpoint 2, add_cups_options (key=0x7fe101636ca0 "cups-PageSize", value=0x7fe101636c80 "Custom.595.28x841.89",
user_data=0x7fe1014c6970) at /home/all/SourceCode/gtk/gtk+3.0-3.4.2/./modules/printbackends/cups/gtkprintbackendcups.c:521
521 {
(gdb) c
Continuing.
Breakpoint 3, add_cups_options (key=0x7fe101636ca5 "PageSize", value=<optimized out>, user_data=<optimized out>)
at /home/all/SourceCode/gtk/gtk+3.0-3.4.2/./modules/printbackends/cups/gtkprintbackendcups.c:566
566 if (custom_value && !g_str_has_prefix(value, "Custom."))
(gdb) n
573 gtk_cups_request_encode_option (request, key, value);
(gdb) c
Continuing.
The fix simply checks whether the value already has the "Custom." prefix and if so, doesn't insert it again. In the code above the test !g_str_has_prefix(value, "Custom.") fails and processing goes through the 'else' clause on line 573.
- /* Add "Custom." prefix to custom values. */
- if (custom_value)
+ /* Add "Custom." prefix to custom values (if they don't already have the prefix). */
+ if (custom_value && !g_str_has_prefix(value, "Custom."))
I created a fix and tested it successfully:
Breakpoint 2, add_cups_options (key=0x7fe101636ca0 "cups-PageSize", value=0x7fe1016 36c80 "Custom. 595.28x841. 89", data=0x7fe1014c 6970) at /home/all/ SourceCode/ gtk/gtk+ 3.0-3.4. 2/./modules/ printbackends/ cups/gtkprintba ckendcups. c:521
user_
521 {
(gdb) c
Continuing.
Breakpoint 3, add_cups_options (key=0x7fe101636ca5 "PageSize", value=<optimized out>, user_data= <optimized out>) SourceCode/ gtk/gtk+ 3.0-3.4. 2/./modules/ printbackends/ cups/gtkprintba ckendcups. c:566 has_prefix( value, "Custom.")) request_ encode_ option (request, key, value);
at /home/all/
566 if (custom_value && !g_str_
(gdb) n
573 gtk_cups_
(gdb) c
Continuing.
The fix simply checks whether the value already has the "Custom." prefix and if so, doesn't insert it again. In the code above the test !g_str_ has_prefix( value, "Custom.") fails and processing goes through the 'else' clause on line 573.
- /* Add "Custom." prefix to custom values. */ has_prefix( value, "Custom."))
- if (custom_value)
+ /* Add "Custom." prefix to custom values (if they don't already have the prefix). */
+ if (custom_value && !g_str_
A debdiff (for Precise) is attached.