summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-11-05 15:15:23 +1100
committerDamien Miller <djm@mindrot.org>2005-11-05 15:15:23 +1100
commit653b93be5d67a918419e63db34383aa3a552db12 (patch)
treec5951b1803f93558752e5ccaf42cc21e36cd6fc2 /sftp.c
parent788f212aed68781efe7aa80e625c5f8cd4d98100 (diff)
- dtucker@cvs.openbsd.org 2005/10/31 06:15:04
[sftp.c] Fix sorting with "ls -1" command. From Robert Tsai, "looks right" deraadt@
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sftp.c b/sftp.c
index f29927c0f..ff3223ad2 100644
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
16 16
17#include "includes.h" 17#include "includes.h"
18 18
19RCSID("$OpenBSD: sftp.c,v 1.67 2005/09/13 23:40:07 djm Exp $"); 19RCSID("$OpenBSD: sftp.c,v 1.68 2005/10/31 06:15:04 dtucker Exp $");
20 20
21#ifdef USE_LIBEDIT 21#ifdef USE_LIBEDIT
22#include <histedit.h> 22#include <histedit.h>
@@ -697,6 +697,8 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
697 } 697 }
698 698
699 if (lflag & SORT_FLAGS) { 699 if (lflag & SORT_FLAGS) {
700 for (n = 0; d[n] != NULL; n++)
701 ; /* count entries */
700 sort_flag = lflag & (SORT_FLAGS|LS_REVERSE_SORT); 702 sort_flag = lflag & (SORT_FLAGS|LS_REVERSE_SORT);
701 qsort(d, n, sizeof(*d), sdirent_comp); 703 qsort(d, n, sizeof(*d), sdirent_comp);
702 } 704 }