nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 34238dc1199b9bd1bf94c4bc59e4bad744d0d698
parent 18a40caa4881e76e320012f43826682ad954bc63
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 13 Jul 2022 16:18:15 +0200

files: designate the root directory with a simple "/", not with "//"

The double slash would derail the file browser, causing a crash.

This fixes https://savannah.gnu.org/bugs/?62760.
Reported-by: Frank Wolff

Bug existed since version 6.3, commit fdd946c0.

Diffstat:
Msrc/files.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -1379,8 +1379,9 @@ char *get_full_path(const char *origpath) } } - /* Ensure that a directory path ends with a slash. */ - if (target && stat(target, &fileinfo) == 0 && S_ISDIR(fileinfo.st_mode)) { + /* Ensure that a non-apex directory path ends with a slash. */ + if (target && target[1] && stat(target, &fileinfo) == 0 && + S_ISDIR(fileinfo.st_mode)) { target = nrealloc(target, strlen(target) + 2); strcat(target, "/"); }