diff options
author | Rob Landley <rob@landley.net> | 2015-10-27 23:12:48 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-10-27 23:12:48 -0500 |
commit | 87f6a93fc594934b21fcd0e9d42baad2abb209ae (patch) | |
tree | 7bf5ab8a1b99a466bf8ab5406194f73e6de755af /toys/posix | |
parent | 10a942f7a67fe7f8dc6c17c3115449f5034fb607 (diff) | |
download | toybox-87f6a93fc594934b21fcd0e9d42baad2abb209ae.tar.gz |
Fix ls error message for chmod -r directories.
Also, if you mkdir "$(echo -e "one\ntwo"); chmod -r one*; ls -q one*
it honors -q.
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/ls.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c index c815ab63..968b2537 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -297,6 +297,13 @@ static void listfiles(int dirfd, struct dirtree *indir) *colsizes = (unsigned *)(toybuf+260), columns = (sizeof(toybuf)-260)/4; char tmp[64]; + if (-1 == dirfd) { + strwidth(indir->name); + perror_msg("%s", indir->name); + + return; + } + memset(totals, 0, sizeof(totals)); // Top level directory was already populated by main() |