mirror of
https://https.git.savannah.gnu.org/git/nano.git
synced 2026-01-26 16:09:15 +00:00
files: include also the slash when re-adding the filename to the path
Otherwise a mistaken name gets recorded in the file-positions history. Buglet existed since version 6.1, commit fdd946c0.
This commit is contained in:
parent
71c60563a2
commit
3b983dd889
@ -1419,8 +1419,9 @@ char *get_full_path(const char *origpath)
|
||||
|
||||
/* Upon success, re-add the last component of the original path. */
|
||||
if (target) {
|
||||
target = nrealloc(target, strlen(target) + strlen(slash + 1) + 1);
|
||||
strcat(target, slash + 1);
|
||||
*slash = '/';
|
||||
target = nrealloc(target, strlen(target) + strlen(slash) + 1);
|
||||
strcat(target, slash);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user