git: ls(1): Fix sort-by-size bug

John Marino marino at crater.dragonflybsd.org
Tue Dec 8 14:46:42 PST 2015


commit c98688068db5d766bdb707c4eafdb16daac1cf2d
Author: John Marino <draco at marino.st>
Date:   Tue Dec 8 23:41:22 2015 +0100

    ls(1): Fix sort-by-size bug
    
    For a reason that escapes me, in order to sort files by size using ls(1),
    one had to pass both the size sort switch (-S) and the time sort switch
    (-t), otherwise the -S flag would be ignored.  This hacky workaround was
    documented in the man page as well.
    
    Let's fix this with code taken from FreeBSD.  The -t and -S switches are
    now mutually exclusive.  If someone uses them together, then the last
    one wins (e.g. ls -st sorts by mod. time and -ts sorts by file size)

Summary of changes:
 bin/ls/ls.1 | 13 ++++++++++---
 bin/ls/ls.c | 31 +++++++++++++++++--------------
 2 files changed, 27 insertions(+), 17 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c98688068db5d766bdb707c4eafdb16daac1cf2d


-- 
DragonFly BSD source repository



More information about the Commits mailing list