[Toybox] ls (/-b/-q) (/on a tty)

enh enh at google.com
Fri Dec 8 10:58:18 PST 2017


the Android Studio folks noticed that `ls foo\ bar` changed from
returning "foo bar" to "foo\ bar" recently.

testing a little bit, -b and -q seem to be wrong, and it seems like a
tty should imply -q rather than -b. (`info ls` agrees about the
latter, but doesn't distinguish between the two demonstrably different
sets of "non-graphic" characters for -b and -q.)

the attached patch includes tests and a fix, though it's not obvious
from the git history why you've gone back and forth here over time,
nor are there any existing tests to capture whatever it was. (the
patch doesn't include a test for the defaults, because i don't know
how to write one, but it does at least test -b and -q in two obvious
cases.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-b-q-and-the-default-for-a-tty.patch
Type: text/x-patch
Size: 2322 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20171208/30b632c6/attachment-0002.bin>


More information about the Toybox mailing list