]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix length calculation
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 10 Dec 2022 21:23:34 +0000 (02:53 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 10 Dec 2022 21:31:19 +0000 (03:01 +0530)
src/nnn.c

index 597869ce2b23e01895acf6878af0837f0abeaf43..89235b4461034a25d63f6955c2e5f4420d230c59 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -8573,8 +8573,10 @@ int main(int argc, char *argv[])
                        DPRINTF_S(arg);
                        size_t len = xstrlen(arg);
 
-                       if (len > 7 && is_prefix(arg, "file://", 7))
+                       if (len > 7 && is_prefix(arg, "file://", 7)) {
                                arg = arg + 7;
+                               len -= 7;
+                       }
                        initpath = abspath(arg, NULL, NULL);
                        DPRINTF_S(initpath);
                        if (!initpath) {