Commit Graph

20 Commits

Author SHA1 Message Date
sin
5552db75ba Don't call var "read" 2015-02-01 10:22:11 +00:00
FRIGN
986a9de51a Add even stricter UTF-8-support to wc(1)
using readrune() and iswspace().
musl for instance doesn't differentiate between iswspace() and
isspace(), but when it does, the code will be ready.
It goes without saying that GNU coreutils don't use iswspace()[0].

[0]: http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f=src/wc.c
2015-02-01 04:06:06 +01:00
FRIGN
8ab096d2a4 Finish up wc(1)
Use size_t for all counts, fix the manpage and refactor the code.
Here's yet another place where GNU coreutils fail:

sbase:
$ echo "GNU/Turd sucks" | wc -cm
    15

coreutils:
$ echo "GNU/Turd sucks" | wc -cm
     15      15

Take a bloody guess which behaviour is correct[0].

[0]: http://pubs.opengroup.org/onlinepubs/009604499/utilities/wc.html
2015-02-01 03:01:11 +01:00
FRIGN
ec8246bbc6 Un-boolify sbase
It actually makes the binaries smaller, the code easier to read
(gems like "val == true", "val == false" are gone) and actually
predictable in the sense of that we actually know what we're
working with (one bitwise operator was quite adventurous and
should now be fixed).

This is also more consistent with the other suckless projects
around which don't use boolean types.
2014-11-14 10:54:20 +00:00
FRIGN
eee98ed3a4 Fix coding style
It was about damn time. Consistency is very important in such a
big codebase.
2014-11-13 18:08:43 +00:00
sin
0c5b7b9155 Stop using EXIT_{SUCCESS,FAILURE} 2014-10-02 23:46:59 +01:00
sin
b744ad5216 If there's no newline we don't count the last word - fix it 2014-01-10 22:52:00 +00:00
sin
b8edf3b4ee Add weprintf() and replace fprintf(stderr, ...) calls
There is still some programs left to be updated for this.

Many of these programs would stop on the first file that they
could not open.
2013-11-13 11:41:43 +00:00
sin
f349dd5987 Use arg.h as much as possible and add usage() where missing
Rename eusage() to usage() as well.
2013-10-07 17:13:01 +01:00
sin
c1730c78de Use int instead of char for getc() 2013-07-20 11:35:56 -04:00
David Galos
9f8deb4b23 Tar compiles on BSD, thanks Roberto E. Vargas Caballero. Also remove tons of trailing whitespace. 2013-07-20 01:27:42 -04:00
Federico G. Benavento
5c7b7e3fa8 s/getopt/ARGBEGIN/ wc 2013-03-10 21:12:10 -03:00
Connor Lane Smith
6be3e82218 add cksum 2011-06-10 04:14:05 +01:00
Connor Lane Smith
ff97891dad add fold 2011-06-08 21:30:33 +01:00
Connor Lane Smith
0a3a8c55e4 ls cleanup 2011-05-27 23:56:43 +01:00
Connor Lane Smith
6ef3d9174b add ls; simpler pwd 2011-05-26 04:01:20 +01:00
Connor Lane Smith
f458397d5a no, getopt.h is gnu specific 2011-05-24 18:58:36 +01:00
pancake
da547fb294 add missing #include <getopt.h>
do not override CC in config.mk
2011-05-24 14:34:26 +02:00
Connor Lane Smith
9714d7b1d3 getopt 2011-05-24 01:13:34 +01:00
Connor Lane Smith
8e26716a5a initial commit 2011-05-23 02:36:34 +01:00