View | Details | Raw Unified | Return to bug 3248
Collapse All | Expand All

(-)a/sftp.c (-3 / +6 lines)
Lines 867-875 sglob_comp(const void *aa, const void *bb) Link Here
867
#define NCMP(a,b) (a == b ? 0 : (a < b ? 1 : -1))
867
#define NCMP(a,b) (a == b ? 0 : (a < b ? 1 : -1))
868
	if (sort_flag & LS_NAME_SORT)
868
	if (sort_flag & LS_NAME_SORT)
869
		return (rmul * strcmp(ap, bp));
869
		return (rmul * strcmp(ap, bp));
870
	else if (sort_flag & LS_TIME_SORT)
870
	else if (sort_flag & LS_TIME_SORT) {
871
		return (rmul * timespeccmp(&as->st_mtim, &bs->st_mtim, <));
871
		if (timespeccmp(&as->st_mtim, &bs->st_mtim, ==))
872
	else if (sort_flag & LS_SIZE_SORT)
872
			return 0;
873
		return timespeccmp(&as->st_mtim, &bs->st_mtim, <) ?
874
		    rmul : -rmul;
875
	} else if (sort_flag & LS_SIZE_SORT)
873
		return (rmul * NCMP(as->st_size, bs->st_size));
876
		return (rmul * NCMP(as->st_size, bs->st_size));
874
877
875
	fatal("Unknown ls sort type");
878
	fatal("Unknown ls sort type");

Return to bug 3248