# HG changeset patch
# User Volker Birk <vb@pep.foundation>
# Date 1508051119 -7200
# Node ID da8160da8d3eb704e9386b8660206807df357817
# Parent  fa7016d4831785845cae5bed8447d8b84958872d
glob() does not sort any more - adding sorted() function

diff -r fa7016d48317 -r da8160da8d3e backend.py
--- a/backend.py	Thu Sep 21 07:57:17 2017 +0200
+++ b/backend.py	Sun Oct 15 09:05:19 2017 +0200
@@ -725,14 +725,14 @@
                 filemask = arg
 
         if filemask[0] == '/' or filemask[0] == '.':
-            files = glob(filemask)
+            files = sorted(glob(filemask))
         else:
             files = []
             for directory in includePath:
                 path = os.path.join(directory, filemask)
-                files.extend(glob(path))
-
-        if reverse:
+                files.extend(sorted(glob(path)))
+
+        if files and reverse:
             files = files[-1::-1]
 
         if not(files):