sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit b83916ca270512badafc58ee6cc5f3b26c348ed3
parent a88906b423e57e74a5bbaf1e315a58770d51c628
Author: FRIGN <dev@frign.de>
Date:   Fri, 26 Feb 2016 00:36:53 +0100

Add symbol to mark NUL handling in each tool (and where it is missing)

The assumption of NUL-terminated strings is actually quite a good one in
most cases. You don't have to worry about paths, because they may not
contain NUL.
Same applies to arguments passed to you. Unless you have to unescape,
there is no way for you to receive a NUL.

There are two important exceptions though, and it's important that we
address them, or else we get unexpected behaviour:

	1) All tools using unescape() have to be strict about delimlen.
	   Else they end up for instance unescaping
	   	'\\0abc'
	   to
	   	'\0abc',
	   which in C's string-vision is an empty string.

	2) All tools doing line wrenching and putting them out
	   again as lines again.
	   puts() will cut each line containing NULs off at the first
	   occurence.

Diffstat:
MREADME | 190++++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 95 insertions(+), 95 deletions(-)

diff --git a/README b/README @@ -8,104 +8,104 @@ The following tools are implemented: '#' -> UTF-8 support, '=' -> Implicit UTF-8 support, '*' -> Finished, '|' -> Audited, 'o' -> POSIX 2013 compliant, 'x' -> Non-POSIX, -'()' -> Petty flag +'0' -> NUL handling, '()' -> Petty flag UTILITY MISSING ------- ------- -=*|o basename . -=*|o cal . -=*|o cat . -=*|o chgrp . -=*|o chmod . -=*|o chown . -=*|x chroot . -=*|o cksum . -=*|o cmp . -#*|x cols . -=*|o comm . -=*|o cp (-i) -=*|x cron . -#*|o cut . -=*|o date . -=*|o dirname . -=*|o du . -=*|o echo . - o ed . -=*|o env . -#*|o expand . -#*|o expr . -=*|o false . -= find . -=* x flock . -#*|o fold . -=*|o getconf (-v) -=*|o grep . -=*|o head . -=*|x hostname . -=*|x install . -=* o join . -=*|o kill . -=*|o link . -=*|o ln . -=*|o logger . -=*|o logname . -#* o ls (-C, -k, -m, -p, -s, -x) -=*|x md5sum . -=*|o mkdir . -=*|o mkfifo . -=*|x mktemp . -=*|o mv (-i) -=*|o nice . -#*|o nl . -=*|o nohup . -=*|o od . -#* o pathchk . -#*|o paste . -=*|x printenv . -#*|o printf . -=*|o pwd . -=*|x readlink . -=*|o renice . -=*|o rm (-i) -=*|o rmdir . -# sed . -=*|x seq . -=*|x setsid . -=*|x sha1sum . -=* x sha224sum . -=*|x sha256sum . -=* x sha238sum . -=*|x sha512sum . -=* x sha512-224sum . -=* x sha512-256sum . -=*|o sleep . -#*|o sort . -=*|o split . -=*|x sponge . -#*|o strings . -=*|x sync . -=*|o tail . -=*|x tar . -=*|o tee . -=*|o test . -=*|x tftp . -=*|o time . -=*|o touch . -#*|o tr . -=*|o true . -=* o tsort . -=*|o tty . -=*|o uname . -#*|o unexpand . -=*|o uniq . -=*|o unlink . -=*|o uudecode . -=*|o uuencode . -#*|o wc . -=*|x which . -=*|x whoami . -=*|o xargs (-p) -=*|x yes . +0=*|o basename . +0=*|o cal . +0=*|o cat . +0=*|o chgrp . +0=*|o chmod . +0=*|o chown . +0=*|x chroot . +0=*|o cksum . +0=*|o cmp . + #*|x cols . + =*|o comm . +0=*|o cp (-i) +0=*|x cron . + #*|o cut . +0=*|o date . +0=*|o dirname . +0=*|o du . +0=*|o echo . + o ed . +0=*|o env . +0#*|o expand . +0#*|o expr . +0=*|o false . +0= find . +0=* x flock . + #*|o fold . +0=*|o getconf (-v) + =*|o grep . + =*|o head . +0=*|x hostname . +0=*|x install . + =* o join . +0=*|o kill . +0=*|o link . +0=*|o ln . + =*|o logger . +0=*|o logname . +0#* o ls (-C, -k, -m, -p, -s, -x) +0=*|x md5sum . +0=*|o mkdir . +0=*|o mkfifo . +0=*|x mktemp . +0=*|o mv (-i) +0=*|o nice . + #*|o nl . +0=*|o nohup . +0=*|o od . +0#* o pathchk . + #*|o paste . +0=*|x printenv . +0#*|o printf . +0=*|o pwd . +0=*|x readlink . +0=*|o renice . +0=*|o rm (-i) +0=*|o rmdir . + # sed . +0=*|x seq . +0=*|x setsid . +0=*|x sha1sum . +0=* x sha224sum . +0=*|x sha256sum . +0=* x sha238sum . +0=*|x sha512sum . +0=* x sha512-224sum . +0=* x sha512-256sum . +0=*|o sleep . + #*|o sort . +0=*|o split . +0=*|x sponge . +0#*|o strings . +0=*|x sync . + =*|o tail . +0=*|x tar . +0=*|o tee . +0=*|o test . +0=*|x tftp . +0=*|o time . +0=*|o touch . +0#*|o tr . +0=*|o true . +0=* o tsort . +0=*|o tty . +0=*|o uname . +0#*|o unexpand . + =*|o uniq . +0=*|o unlink . +0=*|o uudecode . +0=*|o uuencode . +0#*|o wc . +0=*|x which . +0=*|x whoami . + =*|o xargs (-p) +0=*|x yes . The complement of sbase is ubase[1] which is Linux-specific and provides all the non-portable tools. Together they are intended to