tweaks: rename a variable, normalize a comment, and reshuffle a free()
Этот коммит содержится в:
родитель
dbcf4f0cbe
Коммит
21e307e820
12
src/color.c
12
src/color.c
@ -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. */
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user