summary refs log tree commit diff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-10-27 11:45:01 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2014-10-27 11:45:01 +0800
commitc77265b4ea89359c164346e400914bb24a3716d1 (patch)
treedea5be70f45e35433f62a505f4764148e8019058
parent[CD] support drive letters on Cygwin (diff)
downloaddash-c77265b4ea89359c164346e400914bb24a3716d1.tar.gz
dash-c77265b4ea89359c164346e400914bb24a3716d1.zip
[BUILTIN] Add printf support for format string a, A, and F
This patch adds the format string characters a, A and F to the
supported set of the built-in printf command.  They're already
supported by the underlying printf function.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--ChangeLog4
-rw-r--r--src/bltin/printf.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2155764..46ef4c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-27  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Add printf support for format string a, A, and F.
+
 2014-10-13  Eric Blake <eblake@redhat.com>
 
 	* cd: support drive letters on Cygwin.
diff --git a/src/bltin/printf.c b/src/bltin/printf.c
index 5f9e81c..e0ef912 100644
--- a/src/bltin/printf.c
+++ b/src/bltin/printf.c
@@ -191,9 +191,12 @@ pc:
 				PF(f, p);
 				break;
 			}
+			case 'a':
+			case 'A':
 			case 'e':
 			case 'E':
 			case 'f':
+			case 'F':
 			case 'g':
 			case 'G': {
 				double p = getdouble();