# HG changeset patch # User Rob Landley # Date 1414665174 18000 # Node ID dabe462d290b50bc1d78c673ad1bd6d15957d67c # Parent 3e85af1f7e22944a411b160b2b17affb84305f16 Bug report from Isaac Dunham: ls -d shouldn't follow command line symlinks without -H or -L (just like ls -l). diff -r 3e85af1f7e22 -r dabe462d290b toys/posix/ls.c --- a/toys/posix/ls.c Wed Oct 29 18:44:33 2014 -0500 +++ b/toys/posix/ls.c Thu Oct 30 05:32:54 2014 -0500 @@ -487,8 +487,8 @@ // Non-absolute paths are relative to current directory. TT.files = dirtree_add_node(0, 0, 0); for (s = *toys.optargs ? toys.optargs : noargs; *s; s++) { - dt = dirtree_add_node(0, *s, - (toys.optflags & (FLAG_L|FLAG_H|FLAG_l))^FLAG_l); + dt = dirtree_add_node(0, *s, !(toys.optflags & (FLAG_l|FLAG_d)) + || (toys.optflags & (FLAG_L|FLAG_H))); if (!dt) { toys.exitval = 1;