mirror of git://git.sv.gnu.org/nano.git
tweaks: meld two calls of free() into a single one, to elide an 'else'
This commit is contained in:
parent
75a6abe6d2
commit
7b88557ef5
|
@ -197,14 +197,11 @@ void color_update(void)
|
||||||
char *joinednames = charalloc(PATH_MAX + 1);
|
char *joinednames = charalloc(PATH_MAX + 1);
|
||||||
char *fullname = NULL;
|
char *fullname = NULL;
|
||||||
|
|
||||||
if (currentdir == NULL)
|
if (currentdir != NULL) {
|
||||||
free(reserved);
|
|
||||||
else {
|
|
||||||
/* Concatenate the current working directory with the
|
/* Concatenate the current working directory with the
|
||||||
* specified filename, and canonicalize the result. */
|
* 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);
|
||||||
free(currentdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullname == NULL)
|
if (fullname == NULL)
|
||||||
|
@ -217,6 +214,7 @@ void color_update(void)
|
||||||
|
|
||||||
free(joinednames);
|
free(joinednames);
|
||||||
free(fullname);
|
free(fullname);
|
||||||
|
free(reserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the filename didn't match anything, try the first line. */
|
/* If the filename didn't match anything, try the first line. */
|
||||||
|
|
Loading…
Reference in New Issue