From 1f489eb1936921f1f029ca9543480490ca89ae67 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 7 Jun 2021 10:05:40 -0700 Subject: ls(1) parse: set LC_ALL not just LOCALE, and split fields properly Previously our code assumed fields were separated with exactly one space, but sometimes there is padding. Signed-off-by: Sean Whitton --- src/connection.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/connection.lisp') diff --git a/src/connection.lisp b/src/connection.lisp index 3f979d2..9f945a1 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -467,7 +467,7 @@ PATH may be any kind of file, including directories." (#\x order) (#\- 0))))) (and (remote-exists-p path) - (let* ((ls (split-string (run "ls" "-ld" path))) + (let* ((ls (words (run :env '(:LC_ALL "C") "ls" "-ld" path))) (lscar (car ls))) (values (+ (sum (subseq lscar 1 4) #o100) (sum (subseq lscar 4 7) #o10) -- cgit v1.2.3