diff options
author | Leah Neukirchen <leah@vuxu.org> | 2019-12-19 16:50:32 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2019-12-19 16:50:32 +0100 |
commit | 5b4707904748d3bc067900693aeedb14eb78e322 (patch) | |
tree | 327c10c47110670dd67bd74cad8e48d7af982214 | |
parent | e2eb4b4904253dc9afd33f58a77b1e27f32ff408 (diff) | |
download | lr-5b4707904748d3bc067900693aeedb14eb78e322.tar.gz lr-5b4707904748d3bc067900693aeedb14eb78e322.tar.xz lr-5b4707904748d3bc067900693aeedb14eb78e322.zip |
make code C89
-rw-r--r-- | lr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lr.c b/lr.c index bf052fa..9bafe3b 100644 --- a/lr.c +++ b/lr.c @@ -2355,15 +2355,17 @@ recurse(char *path, struct history *h, int guessdir) } if (Wflag && names) { + size_t i; + qsort(names, entries, sizeof (char *), cmpstr); - for (size_t i = 0; i < entries; i++) { + for (i = 0; i < entries; i++) { strcpy(path, names[i]); recurse(path, &new, 1); } - // ensure cleanup in reverse allocation order - for (size_t i = 0; i < entries; i++) + /* ensure cleanup in reverse allocation order */ + for (i = 0; i < entries; i++) free(names[entries-i-1]); free(names); } |