Re: [evolution-patches] Escaping percentage signs in gtkhtml



On Wed, 2004-05-05 at 11:35 +0800, Not Zed wrote:
> 
> Any chance you could include the gcc (glib) string formatting
> attribute stuff in the header file for that function too?
> 
> i.e. append 
> G_GNUC_PRINTF(2,3)
> to the prototype.
> 
> And ChangeLog entries for all changes.

Revised patch attached.

> 
> On Tue, 2004-05-04 at 16:21 -0400, David Malcolm wrote: 
> > Currently the code uses "\%" to write a percentage sign within a format
> > string - is this correct? Shouldn't "%%' be used instead?  The attached
> > patch should fix this.
> > 
> > Dave
> > 
> 
> Michael Zucchi
> <notzed ximian com>
> 
> Ximian Evolution and
> Free Software Developer
> 
> 
> Novell, Inc.
? autom4te.cache
Index: src/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1973
diff -u -p -r1.1973 ChangeLog
--- src/ChangeLog	5 May 2004 13:18:25 -0000	1.1973
+++ src/ChangeLog	5 May 2004 20:14:18 -0000
@@ -1,3 +1,11 @@
+2004-05-05  David Malcolm  <dmalcolm redhat com>
+
+	* htmlimage.c (save): printf-style string should use a "%%" for 
+	a percent sign rather than "\%"
+
+	* htmlengine-save.h (html_engine_save_output_string): add 
+	function attribute G_GNUC_PRINTF
+
 2004-05-05  Radek Doulik  <rodo ximian com>
 
 	* htmltext.c (calc_font_size_filter): set fixed font family here
Index: src/htmlengine-save.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine-save.h,v
retrieving revision 1.25
diff -u -p -r1.25 htmlengine-save.h
--- src/htmlengine-save.h	8 Apr 2003 13:35:48 -0000	1.25
+++ src/htmlengine-save.h	5 May 2004 20:14:18 -0000
@@ -59,7 +59,7 @@ gboolean             html_engine_save_ou
 							    va_list                    ap);
 gboolean             html_engine_save_output_string        (HTMLEngineSaveState       *state,
 							    const gchar               *format,
-							    ...);
+							    ...) G_GNUC_PRINTF (2, 3);
 
 /* Saving a whole tree.  */
 gboolean             html_engine_save                      (HTMLEngine                *engine,
Index: src/htmlimage.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlimage.c,v
retrieving revision 1.198
diff -u -p -r1.198 htmlimage.c
--- src/htmlimage.c	3 May 2004 15:37:42 -0000	1.198
+++ src/htmlimage.c	5 May 2004 20:14:19 -0000
@@ -593,7 +593,7 @@ save (HTMLObject *self,
 		return FALSE;	
 
 	if (image->percent_width) {
-		if (!html_engine_save_output_string (state, " WIDTH=\"%d\%\"", image->specified_width))
+		if (!html_engine_save_output_string (state, " WIDTH=\"%d%%\"", image->specified_width))
 			return FALSE;
 	} else if (image->specified_width > 0) {
 		if (!html_engine_save_output_string (state, " WIDTH=\"%d\"", image->specified_width))
@@ -601,7 +601,7 @@ save (HTMLObject *self,
 	}
 
 	if (image->percent_height) {
-		if (!html_engine_save_output_string (state, " HEIGHT=\"%d\%\"", image->specified_height))
+		if (!html_engine_save_output_string (state, " HEIGHT=\"%d%%\"", image->specified_height))
 			return FALSE;
 	} else if (image->specified_height > 0) {
 		if (!html_engine_save_output_string (state, " HEIGHT=\"%d\"", image->specified_height))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]