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
.
master
parent
7b88557ef5
commit
dbcf4f0cbe
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue