tweaks: rename a variable, normalize a comment, and reshuffle a free()

master
Benno Schulenberg 2019-09-16 17:24:49 +02:00
parent dbcf4f0cbe
commit 21e307e820
1 changed files with 6 additions and 6 deletions

View File

@ -192,14 +192,14 @@ void color_update(void)
/* If no syntax-override string was specified, or it didn't match, /* If no syntax-override string was specified, or it didn't match,
* try finding a syntax based on the filename (extension). */ * try finding a syntax based on the filename (extension). */
if (sint == NULL && !inhelp) { if (sint == NULL && !inhelp) {
char *reserved = charalloc(PATH_MAX + 1); char *reservation = charalloc(PATH_MAX + 1);
char *currentdir = getcwd(reserved, PATH_MAX + 1); char *currentdir = getcwd(reservation, PATH_MAX + 1);
char *joinednames = charalloc(PATH_MAX + 1); char *joinednames = charalloc(PATH_MAX + 1);
char *fullname = NULL; 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] != '/') { 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); sprintf(joinednames, "%s/%s", currentdir, openfile->filename);
fullname = get_full_path(joinednames); fullname = get_full_path(joinednames);
} }
@ -212,9 +212,9 @@ void color_update(void)
break; break;
} }
free(joinednames);
free(fullname); free(fullname);
free(reserved); free(joinednames);
free(reservation);
} }
/* If the filename didn't match anything, try the first line. */ /* If the filename didn't match anything, try the first line. */