[Commit] nickle printf.5c,1.7,1.8

Bart Massey commit at keithp.com
Fri Feb 6 16:47:01 PST 2004


Committed by: bart

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv3035

Modified Files:
	printf.5c 
Log Message:
Made printf format strings of the form %0* work properly.



Index: printf.5c
===================================================================
RCS file: /local/src/CVS/nickle/printf.5c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- printf.5c	13 Oct 2003 05:48:57 -0000	1.7
+++ printf.5c	7 Feb 2004 00:46:58 -0000	1.8
@@ -112,8 +112,10 @@
 		 * width
 		 */
 		
-		int width = 0;
 		string fill = " ";
+		if (fmt::match('0'))
+		    fill = "0";
+		int width = 0;
 		if (fmt::match('*'))
 		    width = arg::next ();
 		else
@@ -121,8 +123,6 @@
 		    int sign = 1;
 		    if (fmt::match('-'))
 			sign = -1;
-		    if (fmt::match('0'))
-			fill = "0";
 		    width = fmt::number () * sign;
 		}
 		




More information about the Commit mailing list