summaryrefslogtreecommitdiff
path: root/userland/minibox/utilities/echo.c
diff options
context:
space:
mode:
Diffstat (limited to 'userland/minibox/utilities/echo.c')
-rw-r--r--userland/minibox/utilities/echo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/userland/minibox/utilities/echo.c b/userland/minibox/utilities/echo.c
index 5ec68a7..f184d4a 100644
--- a/userland/minibox/utilities/echo.c
+++ b/userland/minibox/utilities/echo.c
@@ -7,24 +7,27 @@
int echo(char **str, int new_line) {
for (; *str;) {
printf("%s", *str);
- if (*++str)
+ if (*++str) {
putchar(' ');
+ }
}
- if (new_line)
+ if (new_line) {
putchar('\n');
+ }
return 0;
}
int echo_main(int argc, char **argv) {
int new_line = 1;
- for (; *++argv && '-' == **argv;)
+ for (; *++argv && '-' == **argv;) {
switch (*(*argv + 1)) {
case 'n':
new_line = 0;
break;
}
+ }
return echo(argv, new_line);
}