commit 3f309bc36a4b831b941abcb30476571aa704d340
parent 2516b6404645632872a366125250458646d2c200
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 19 Nov 2018 11:47:02 +0100
tweaks: rename three variables, and reshuffle two declarations
Diffstat:
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -538,31 +538,32 @@ static void parse_one_include(char *file)
/* Expand globs in the passed name, and parse the resultant files. */
void parse_includes(char *ptr)
{
- char *option, *nanorc_save = nanorc, *expanded;
- size_t lineno_save = lineno, i;
+ char *pattern, *expanded;
+ char *was_nanorc = nanorc;
+ size_t was_lineno = lineno;
glob_t files;
- option = ptr;
- if (*option == '"')
- option++;
+ pattern = ptr;
+ if (*pattern == '"')
+ pattern++;
ptr = parse_argument(ptr);
/* Expand tildes first, then the globs. */
- expanded = real_dir_from_tilde(option);
+ expanded = real_dir_from_tilde(pattern);
if (glob(expanded, GLOB_ERR|GLOB_NOSORT, NULL, &files) == 0) {
- for (i = 0; i < files.gl_pathc; ++i)
+ for (size_t i = 0; i < files.gl_pathc; ++i)
parse_one_include(files.gl_pathv[i]);
} else
- rcfile_error(_("Error expanding %s: %s"), option, strerror(errno));
+ rcfile_error(_("Error expanding %s: %s"), pattern, strerror(errno));
globfree(&files);
free(expanded);
/* We're done with the included file(s). Restore the original
* filename and line number position. */
- nanorc = nanorc_save;
- lineno = lineno_save;
+ nanorc = was_nanorc;
+ lineno = was_lineno;
}
/* Return the short value corresponding to the color named in colorname,