]> Sergey Matveev's repositories - nnn.git/commitdiff
Add early check
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 9 Sep 2021 12:35:24 +0000 (18:05 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Thu, 9 Sep 2021 12:35:51 +0000 (18:05 +0530)
src/nnn.c

index a217d6b15f4f7f83390d42caaf66b32e667dc692..70001873d942c5fd490de035de3353f0130851b0 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -6577,10 +6577,10 @@ begin:
        }
 #endif
 
-       if (cfgsort[cfg.curctx] != '0') {
+       if (order && cfgsort[cfg.curctx] != '0') {
                if (cfgsort[cfg.curctx] == 'z')
                        set_sort_flags('c');
-               if (order && (!cfgsort[cfg.curctx] || (cfgsort[cfg.curctx] == 'c'))
+               if ((!cfgsort[cfg.curctx] || (cfgsort[cfg.curctx] == 'c'))
                    && ((r = get_kv_key(order, path, maxorder, NNN_ORDER)) > 0)) {
                        set_sort_flags(r);
                        cfgsort[cfg.curctx] = 'z';