]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix context range check
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 5 May 2020 11:44:42 +0000 (17:14 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 5 May 2020 11:44:42 +0000 (17:14 +0530)
plugins/README.md
src/nnn.c

index 292c06b03c07df0f9eadd349385aa20986448cda..3ea9949ae9f88d1347dc9bcb3ae924139905783b 100644 (file)
@@ -188,7 +188,7 @@ Usage examples can be found in the Examples section below.
 
 #### Get notified on file hover
 
-If `NNN_FIFO` is set, `nnn` will open it and write every hovered files. This can be used in plugins, e.g. to implement file previews.
+If `NNN_FIFO` is set, `nnn` will open it and write every hovered files. This can be used in plugins and external scripts, e.g. to implement file previews.
 
 If a `NNN_FIFO` is set globally, each `nnn` instance will write to it, and a process reading from the pipe will get hovered path from every instance, interleaved.
 
index e6463931f21a317e6507e2f23cb217389edeb200..f915ca791ba00b99fae901d8ee050464aa01587a 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4258,7 +4258,7 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
                ctx = r + 1;
        } else {
                ctx = g_buf[0] - '0';
-               if (ctx > CTX_MAX)
+               if (ctx < 0 || ctx > CTX_MAX)
                        return;
        }