nano

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

commit dbcf4f0cbef7134685c571a5e4b49830a2432068
parent 7b88557ef5eb080cd4c957025ef6b0bebf16d460
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 16 Sep 2019 16:57:46 +0200

color: don't concatenate an absolute path with the working directory

When the user specified an absolute path... it is NOT relative to the
current working directory.

This fixes https://savannah.gnu.org/bugs/?56902.
Reported-by: Brand Huntsman <alpha@qzx.com>

Bug existed since version 2.4.2, commit ec8d51be.

Diffstat:
Msrc/color.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/color.c b/src/color.c @@ -197,7 +197,7 @@ void color_update(void) char *joinednames = charalloc(PATH_MAX + 1); char *fullname = NULL; - if (currentdir != NULL) { + if (currentdir != NULL && openfile->filename[0] != '/') { /* Concatenate the current working directory with the * specified filename, and canonicalize the result. */ sprintf(joinednames, "%s/%s", currentdir, openfile->filename);