foxygit / doom Log in
commit 6a87a917afb090dab585bce8b2aba5db1accdc6b
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Mon Oct 29 23:24:13 2018 -0400
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Mon Oct 29 23:24:13 2018 -0400

    Oops.
---
 src/i_glob.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/i_glob.c b/src/i_glob.c
index d186c980..9cd91ad4 100644
--- a/src/i_glob.c
+++ b/src/i_glob.c
@@ -224,13 +224,13 @@ static void SortFilenames(char **filenames, int len, int flags)
     char *pivot, *tmp;
     int i, left_len, cmp;

-    if (len < 2)
+    if (len <= 1)
     {
         return;
     }
-    pivot = filenames[0];
+    pivot = filenames[len - 1];
     left_len = 0;
-    for (i = 1; i < len; ++i)
+    for (i = 0; i < len-1; ++i)
     {
         if ((flags & GLOB_FLAG_NOCASE) != 0)
         {