- fix invocation without any argument
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 8 Jun 2007 12:52:17 +0000 (12:52 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 8 Jun 2007 12:52:17 +0000 (12:52 -0000)
coreutils/echo.c

index 1016d3876dd1cac7792dfc7bf7bffa8488d10187..11507b43801410ee5b27d3ad3b6742e4aef0fa22 100644 (file)
@@ -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');
        }