From 5d3642b8ef920316693031d2ea34b9def0b1abc5 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Thu, 22 Apr 2021 08:55:35 -0700 Subject: chore: rm unfinished projects --- sys/cmd/echo/echo.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 sys/cmd/echo/echo.c (limited to 'sys/cmd/echo/echo.c') 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 -#include - -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); -} -- cgit v1.2.1