From bc70095df2ea1bc4338ea7331d44b916e0c82258 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Sat, 22 Jun 2013 03:37:51 +0100 Subject: stdbuf: make it mandatory to specify a buffering option This is consistent with the documented interface and avoids any ambiguity in a user thinking that stdbuf without options might reset to a "standard" buffering setup. * src/stdbuf.c (set_libstdbuf_options): Indicate with the return value whether any env variables were actually set. (main): Fail unless some env variables were set. * tests/misc/stdbuf.sh: Ensure this constraint is enforced. * NEWS: Mention the small change in behavior. --- tests/misc/stdbuf.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/misc/stdbuf.sh b/tests/misc/stdbuf.sh index 12347ecc7..650e8e737 100755 --- a/tests/misc/stdbuf.sh +++ b/tests/misc/stdbuf.sh @@ -50,6 +50,8 @@ stdbuf -o$SIZE_OFLOW true # size too large test $? = 125 || fail=1 stdbuf -iL true # line buffering stdin disallowed test $? = 125 || fail=1 +stdbuf true # a buffering mode must be specified +test $? = 125 || fail=1 stdbuf -i0 -o0 -e0 true || fail=1 #check all files stdbuf -o1 . # invalid command test $? = 126 || fail=1 -- cgit v1.2.3-54-g00ecf