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:
Benno Schulenberg 2025-11-19 11:48:12 +01:00
parent 71c60563a2
commit 3b983dd889

View File

@ -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);
}
}