--- dir.c.orig	Sat Jul 12 21:19:05 1997
+++ dir.c	Fri Mar 23 21:59:00 2012
@@ -358,8 +358,11 @@ int setdir (struct dir *d, char *dirname)
 
 	d->topfile = d->curfile = 0;
 
-	compdir = d;
-	qsort ((char*)d->cat, (unsigned) d->num, sizeof (d->cat[0]), compfile);
+	if (d->sort != SORTSKIP) {
+		compdir = d;
+		qsort ((char*)d->cat, (unsigned) d->num,
+		    sizeof (d->cat[0]), compfile);
+	}
 
 	if (! dirname) {
 		/* retag files, restore curfile */
