From 1e22f610a33903e8525d35a18b1dcf760a93791e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 7 Mar 2020 17:22:08 -0800 Subject: [PATCH] fix for osx - doesn't print 'total xx' line if empty directory (issue #40) --- jc/parsers/ls.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index 40433cfa..c73bc552 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -259,6 +259,11 @@ def parse(data, raw=False, quiet=False): new_section = False continue + # fix for OSX - doesn't print 'total xx' line if empty directory + if new_section and entry == '': + new_section = False + continue + # fixup for filenames with newlines if not new_section \ and not re.match(r'[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', entry):