diff options
author | tjr <tjr@FreeBSD.org> | 2002-06-19 08:16:14 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-06-19 08:16:14 +0000 |
commit | 95dac58041229913b9d0136f098b744eb1e8bea9 (patch) | |
tree | 5a1e8bb96c1414ca95c4262f17267781a7ea3690 /usr.bin/printf/printf.c | |
parent | e03fb12529ca70bb4e2db076ad98cd3a2729c19a (diff) | |
download | FreeBSD-src-95dac58041229913b9d0136f098b744eb1e8bea9.zip FreeBSD-src-95dac58041229913b9d0136f098b744eb1e8bea9.tar.gz |
Allow `%' to be written out with an octal escape (\45 or \045).
PR: 39116
Submitted by: Egil Brendsdal <egilb@ife.no>
MFC after: 1 week
Diffstat (limited to 'usr.bin/printf/printf.c')
-rw-r--r-- | usr.bin/printf/printf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index e0d1591..90f363c 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -376,7 +376,11 @@ escape(fmt) value += *fmt - '0'; } --fmt; - *store = value; + if (value == '%') { + *store++ = '%'; + *store = '%'; + } else + *store = value; break; default: *store = *fmt; |