From f8273a5783a4cd7340879c3a2f955c30ce4903e7 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 13 Nov 2005 22:05:18 +1100 Subject: [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. --- src/bltin/printf.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/bltin') 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; -- cgit 1.4.1