From 3b983dd8895a23d3bc49b4065e660fb304522dcc Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 19 Nov 2025 11:48:12 +0100 Subject: [PATCH] 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. --- src/files.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index da397e6b..ea931eb3 100644 --- a/src/files.c +++ b/src/files.c @@ -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); } }