From: Arun Prakash Jana Date: Thu, 9 Sep 2021 12:35:24 +0000 (+0530) Subject: Add early check X-Git-Tag: v4.3~15 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e7aec90889a3e9fbf23962468701766fc2bd5429;p=nnn.git Add early check --- 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';