aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/echo/echo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/echo/echo.c')
-rw-r--r--sys/cmd/echo/echo.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/sys/cmd/echo/echo.c b/sys/cmd/echo/echo.c
deleted file mode 100644
index adac611..0000000
--- a/sys/cmd/echo/echo.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <u.h>
-#include <libn.h>
-
-int
-main(int argc, char *argv[])
-{
- char *s, *b, *c;
- int i, nnl, len;
- static char buf[2*1024];
-
- nnl = (argc>1) && strcmp(argv[1], "-n")==0;
-
- len = 1;
- for(i = 1+nnl; i < argc; i++)
- len += strlen(argv[i])+1;
-
- if (len >= arrlen(buf)) {
- s = b = calloc(len, sizeof *s);
- if (!s)
- exits("no memory");
- } else
- s = b = buf;
-
- for (i = 1+nnl; i < argc; i++) {
- c = argv[i];
- while(*c)
- *b++ = *c++;
- if (i < argc-1)
- *b++ = ' ';
- }
-
- if (!nnl)
- *b++ = '\n';
-
- if (write(1, s, b-s) < 0)
- exits("write error");
-
- exit(0);
-}