mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 14:20:46 +03:00
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
.
This commit is contained in:
parent
18a40caa48
commit
34238dc119
@ -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, "/");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user