summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/bltin/printf.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/bltin/printf.c b/src/bltin/printf.c
index 9673e10..1112253 100644
--- a/src/bltin/printf.c
+++ b/src/bltin/printf.c
@@ -175,17 +175,24 @@ pc:
 
 			/* skip to field width */
 			fmt += strspn(fmt, SKIP1);
-			if (*fmt == '*')
-				*param++ = getuintmax(1);
-
-			/* skip to possible '.', get following precision */
-			fmt += strspn(fmt, SKIP2);
-			if (*fmt == '.')
+			if (*fmt == '*') {
 				++fmt;
-			if (*fmt == '*')
 				*param++ = getuintmax(1);
+			} else {
+				/* skip to possible '.',
+				 * get following precision
+				 */
+				fmt += strspn(fmt, SKIP2);
+			}
 
-			fmt += strspn(fmt, SKIP2);
+			if (*fmt == '.') {
+				++fmt;
+				if (*fmt == '*') {
+					++fmt;
+					*param++ = getuintmax(1);
+				} else
+					fmt += strspn(fmt, SKIP2);
+			}
 
 			ch = *fmt;
 			if (!ch)
e.global?id=3f7d19f752d2ca879780fffc86874e5429d36e80&follow=1'>Global git ignore .swo filesJune McEnroe 2013-10-14Add Heroku to zshJune McEnroe 2013-09-23Add gst git stash aliasJune McEnroe 2013-09-05Remove pacman stuffJune McEnroe Goodbye Arch. 2013-09-05Only alias hub if it existsJune McEnroe 2013-09-05chruby to ruby-2.0.0June McEnroe 2013-08-14Add nvmJune McEnroe 2013-07-09Add title commandJune McEnroe 2013-06-09Use default client keysJune McEnroe 2013-06-09Run games in separate X serverJune McEnroe 2013-06-08Add game wrapper to kill/restart unclutterJune McEnroe 2013-06-08Add git configJune McEnroe