From 21e307e8206a2fab772495d474023474343162e8 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 16 Sep 2019 17:24:49 +0200 Subject: [PATCH] tweaks: rename a variable, normalize a comment, and reshuffle a free() --- src/color.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/color.c b/src/color.c index fef26d89..da2b429f 100644 --- a/src/color.c +++ b/src/color.c @@ -192,14 +192,14 @@ void color_update(void) /* If no syntax-override string was specified, or it didn't match, * try finding a syntax based on the filename (extension). */ if (sint == NULL && !inhelp) { - char *reserved = charalloc(PATH_MAX + 1); - char *currentdir = getcwd(reserved, PATH_MAX + 1); + char *reservation = charalloc(PATH_MAX + 1); + char *currentdir = getcwd(reservation, PATH_MAX + 1); char *joinednames = charalloc(PATH_MAX + 1); char *fullname = NULL; + /* When the specified filename is not absolute, concatenate it + * with the working directory and canonicalize the result. */ 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); fullname = get_full_path(joinednames); } @@ -212,9 +212,9 @@ void color_update(void) break; } - free(joinednames); free(fullname); - free(reserved); + free(joinednames); + free(reservation); } /* If the filename didn't match anything, try the first line. */