aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-06-28 20:33:54 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-06-28 20:33:54 +0530
commit1faf9f248080ee2acc704af5e948726a2f66fe55 (patch)
tree18a2b90d2fcda83651b7bf5f078df455f8b76c7e
parent4178aaa98ef317bad99b04c6e8ee64428ac2498a (diff)
downloadnnn-1faf9f248080ee2acc704af5e948726a2f66fe55.tar.gz
Revert "Simplify check"
-rw-r--r--src/nnn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 4443022..2f16f5b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4321,11 +4321,13 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
char ctx, *nextpath = NULL;
ssize_t len = read_nointr(fd, g_buf, 1);
- if (len != 1 || g_buf[0] < '0')
+ if (len != 1)
return;
if (g_buf[0] == '+')
ctx = (char)(get_free_ctx() + 1);
+ else if (g_buf[0] < '0')
+ return;
else {
ctx = g_buf[0] - '0';
if (ctx > CTX_MAX)