diff options
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | 18 | ||
19 | RCSID("$OpenBSD: sftp.c,v 1.67 2005/09/13 23:40:07 djm Exp $"); | 19 | RCSID("$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 | } |