7afad6
diff -up openssh-8.0p1/sftp.c.original openssh-8.0p1/sftp.c
7afad6
--- openssh-8.0p1/sftp.c.original	2020-12-22 17:05:02.105698989 +0900
7afad6
+++ openssh-8.0p1/sftp.c	2020-12-22 17:05:42.922035780 +0900
7afad6
@@ -937,7 +937,11 @@ sglob_comp(const void *aa, const void *b
7afad6
 		return (rmul * strcmp(ap, bp));
7afad6
 	else if (sort_flag & LS_TIME_SORT) {
7afad6
 #if defined(HAVE_STRUCT_STAT_ST_MTIM)
7afad6
-		return (rmul * timespeccmp(&as->st_mtim, &bs->st_mtim, <));
7afad6
+		if (timespeccmp(&as->st_mtim, &bs->st_mtim, <)){
7afad6
+			return rmul;
7afad6
+		} else {
7afad6
+			return -rmul;
7afad6
+		}
7afad6
 #elif defined(HAVE_STRUCT_STAT_ST_MTIME)
7afad6
 		return (rmul * NCMP(as->st_mtime, bs->st_mtime));
7afad6
 #else