---
 toys/posix/ls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index 91d35f4f..c24d5bcc 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -169,6 +169,8 @@ static int compare(void *a, void *b)
   if (toys.optflags & FLAG_t) {
     if (dta->st.st_mtime > dtb->st.st_mtime) ret = -1;
     else if (dta->st.st_mtime < dtb->st.st_mtime) ret = 1;
+    else if (dta->st.st_mtim.tv_nsec > dtb->st.st_mtim.tv_nsec) ret = -1;
+    else if (dta->st.st_mtim.tv_nsec < dtb->st.st_mtim.tv_nsec) ret = 1;
   }
   if (!ret) ret = strcmp(dta->name, dtb->name);
   return ret * reverse;
-- 
2.20.1.97.g81188d93c3-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to