summary refs log tree commit diff
path: root/src/bltin
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-11-13 22:05:18 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2005-11-13 22:05:18 +1100
commitf8273a5783a4cd7340879c3a2f955c30ce4903e7 (patch)
tree163deeeb9ae7507da4727017c6b621674ab0bcca /src/bltin
parent[MEMALLOC] Remove unnecessary truncation in _STPUTC (diff)
downloaddash-f8273a5783a4cd7340879c3a2f955c30ce4903e7.tar.gz
dash-f8273a5783a4cd7340879c3a2f955c30ce4903e7.zip
[BUILTIN] Always call conv_escape_str in echocmd
Instead of calling conv_escape_str when we detect a backslash we will call it
unconditionally.  This helps get rid of some unnecessary code in echocmd.
Diffstat (limited to 'src/bltin')
-rw-r--r--src/bltin/printf.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/bltin/printf.c b/src/bltin/printf.c
index fc73dfb..ef9b2b4 100644
--- a/src/bltin/printf.c
+++ b/src/bltin/printf.c
@@ -445,16 +445,10 @@ echocmd(int argc, char **argv)
 	do {
 		char c;
 
-		c = *(*argv)++;
-		if (!c)
-			goto next;
-		if (c != '\\')
-			goto print;
-
-		outstr(conv_escape_str(*argv - 1), outs);
+		outstr(conv_escape_str(*argv), outs);
 		if (rval & 0x100)
 			break;
-next:
+
 		c = ' ';
 		if (!*++argv) {
 end:
@@ -463,7 +457,6 @@ end:
 			}
 			c = '\n';
 		}
-print:
 		outc(c, outs);
 	} while (*argv);
 	return 0;
='logheader'>2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe Hack: output an extra <td> after rendering mdoc so that line numbers can be hidden based on there being three. This required splitting source-filter and about-filter since on about pages there is no table. 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe :target persists after you click on something else. 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe NULs in the input cause an infinite loop in htmlEscape, not to mention regexes obviously not working, etc. 2019-12-16Post "cgit setup"June McEnroe