rpms/gtk2/FC-6 gtk+-2.10.4-cups-multi-value.patch, NONE, 1.1 gtk2.spec, 1.195, 1.196

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Dec 11 17:55:21 UTC 2006


Author: mclasen

Update of /cvs/dist/rpms/gtk2/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv12331

Modified Files:
	gtk2.spec 
Added Files:
	gtk+-2.10.4-cups-multi-value.patch 
Log Message:
Properly pass multi-value options to cups


gtk+-2.10.4-cups-multi-value.patch:
 gtkcupsutils.c |   81 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 75 insertions(+), 6 deletions(-)

--- NEW FILE gtk+-2.10.4-cups-multi-value.patch ---
--- gtk+-2.10.4/modules/printbackends/cups/gtkcupsutils.c.cups-multi-value	2006-12-11 12:51:55.000000000 -0500
+++ gtk+-2.10.4/modules/printbackends/cups/gtkcupsutils.c	2006-12-11 12:52:54.000000000 -0500
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <time.h>
 
+
 typedef void (*GtkCupsRequestStateFunc) (GtkCupsRequest *request);
 
 static void _connect            (GtkCupsRequest *request);
@@ -470,12 +471,80 @@
         }
 
       default:
-        ippAddString (request->ipp_request,
-                      IPP_TAG_OPERATION,
-                      option_tag,
-                      option,
-                      NULL,
-                      value);
+        {
+          char *values;
+          char *s;
+          int in_quotes;
+          char *next;
+          GPtrArray *strings;
+          
+          values = g_strdup (value);
+          strings = NULL;
+          in_quotes = 0;
+          
+          for (s = values, next = s; *s != '\0'; s++)
+            {
+              if (in_quotes != 2 && *s == '\'')
+                {
+                  /* skip quoted value */
+                  if (in_quotes == 0)
+                    in_quotes = 1;
+                  else
+                    in_quotes = 0;
+                }
+              else if (in_quotes != 1 && *s == '\"')
+                {
+                  /* skip quoted value */
+                  if (in_quotes == 0)
+                    in_quotes = 2;
+                  else
+                    in_quotes = 0;
+                }
+              else if (in_quotes == 0 && *s == ',')
+                {
+                  /* found delimiter, add to value array */
+                  *s = '\0';
+                  if (strings == NULL)
+                    strings = g_ptr_array_new ();
+                  g_ptr_array_add (strings, next);
+                  next = s + 1;
+                }
+              else if (in_quotes == 0 && *s == '\\' && s[1] != '\0')
+                {
+                  /* skip escaped character */
+                  s++;
+                }
+            }
+          
+          if (strings == NULL)
+            {
+              /* single value */
+              ippAddString (request->ipp_request,
+                            IPP_TAG_OPERATION,
+                            option_tag,
+                            option,
+                            NULL,
+                            value);
+            }
+          else
+            {
+              /* multiple values */
+              
+              /* add last value */
+              g_ptr_array_add (strings, next);
+              
+              ippAddStrings (request->ipp_request,
+                             IPP_TAG_OPERATION,
+                             option_tag,
+                             option,
+                             strings->len,
+                             NULL,
+                             (const char **) strings->pdata);
+              g_ptr_array_free (strings, TRUE);
+            }
+
+          g_free (values);
+        }
 
         break;
     }


Index: gtk2.spec
===================================================================
RCS file: /cvs/dist/rpms/gtk2/FC-6/gtk2.spec,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -r1.195 -r1.196
--- gtk2.spec	10 Dec 2006 04:39:48 -0000	1.195
+++ gtk2.spec	11 Dec 2006 17:55:14 -0000	1.196
@@ -16,7 +16,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: LGPL
 Group: System Environment/Libraries
 Source: gtk+-%{version}.tar.bz2
@@ -44,6 +44,7 @@
 Patch14: gtk+-2.10.4-message-dialog-a11y.patch
 Patch15: gtk+-2.10.4-mnemonic-clipping.patch
 Patch16: gtk+-2.10.4-close-loader.patch
+Patch17: gtk+-2.10.4-cups-multi-value.patch
 
 BuildPrereq: atk-devel >= %{atk_version}
 BuildPrereq: pango-devel >= %{pango_version}
@@ -140,6 +141,7 @@
 %patch14 -p1 -b .message-dialog-ally
 %patch15 -p1 -b .mnemonic-clipping
 %patch16 -p1 -b .close-loader
+%patch17 -p1 -b .cups-multi-value
 
 for i in config.guess config.sub ; do
 	test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@@ -313,6 +315,9 @@
 %doc tmpdocs/examples
 
 %changelog
+* Mon Dec 11 2006 Matthias Clasen <mclasen at redhat.com> - 2.10.4-8
+- Properly pass multi-value options to cups (#219115)
+
 * Sat Dec  9 2006 Matthias Clasen <mclasen at redhat.com> - 2.10.4-7
 - Fix error handling in pixbuf loaders (#218755)
 - Fix clipping of mnemonic underlines (#218615)




More information about the fedora-cvs-commits mailing list