From dbb06975a89a0c44c1bf78c739bd921a47fb3d11 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 8 Jun 2007 12:51:55 +0000 Subject: [PATCH] - fix invocation without any argument --- coreutils/echo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreutils/echo.c b/coreutils/echo.c index e1eea0007..085e8516c 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -34,6 +34,8 @@ int bb_echo(char **argv) nflag = 1, /* 1 -- print '\n' */ }; arg = *++argv; + if (!arg) + goto newline_ret; #else const char *p; char nflag = 1; @@ -107,9 +109,7 @@ int bb_echo(char **argv) putchar(' '); } -#if ENABLE_FEATURE_FANCY_ECHO newline_ret: -#endif if (nflag) { putchar('\n'); } -- 2.25.1