From e7aec90889a3e9fbf23962468701766fc2bd5429 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 9 Sep 2021 18:05:24 +0530 Subject: [PATCH] Add early check --- src/nnn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index a217d6b1..70001873 100644 --- 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';