From 3a9241add947cb6d24b5de7a8927517426a78795 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 25 Aug 2012 14:25:22 -0500 Subject: Move commands into "posix", "lsb", and "other" menus/directories. --- toys/wc.c | 60 ------------------------------------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 toys/wc.c (limited to 'toys/wc.c') diff --git a/toys/wc.c b/toys/wc.c deleted file mode 100644 index 17801188..00000000 --- a/toys/wc.c +++ /dev/null @@ -1,60 +0,0 @@ -/* vi: set sw=4 ts=4: - * - * wc.c - Word count - * - * Copyright 2011 Rob Landley - * - * See http://opengroup.org/onlinepubs/9699919799/utilities/wc.html - -USE_WC(NEWTOY(wc, "cwl", TOYFLAG_USR|TOYFLAG_BIN)) - -config WC - bool "wc" - default y - help - usage: wc -lwc [FILE...] - - Count lines, words, and characters in input. - - -l show lines - -w show words - -c show characters - - By default outputs lines, words, characters, and filename for each - argument (or from stdin if none). -*/ - -#include "toys.h" - -static void do_wc(int fd, char *name) -{ - int i, len; - unsigned long word=0, lengths[]={0,0,0}; - - for (;;) { - len = read(fd, toybuf, sizeof(toybuf)); - if (len<0) { - perror_msg("%s",name); - toys.exitval = EXIT_FAILURE; - } - if (len<1) break; - for (i=0; i