Renaming two functions, to be more distinguishable --

a leading underscore as the only difference is not enough.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5726 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2016-03-12 09:43:10 +00:00
parent af40fb65ae
commit 3cb80ff7ea
3 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,8 @@
2016-03-12 Benno Schulenberg <bensberg@justemail.net> 2016-03-12 Benno Schulenberg <bensberg@justemail.net>
* src/color.c (color_update): Set the syntax and regex pointers * src/color.c (color_update): Set the syntax and regex pointers
just once, in a single place. And unnest two 'if's. just once, in a single place. And unnest two 'if's.
* src/rcfile.c (parse_one_include, parse_includes): New names for
these functions, to be more distinguishable.
2016-03-11 Benno Schulenberg <bensberg@justemail.net> 2016-03-11 Benno Schulenberg <bensberg@justemail.net>
* src/browser.c (do_browser): Fix compilation when configured with * src/browser.c (do_browser): Fix compilation when configured with

View File

@ -563,7 +563,7 @@ char *parse_argument(char *ptr);
char *parse_next_regex(char *ptr); char *parse_next_regex(char *ptr);
bool nregcomp(const char *regex, int eflags); bool nregcomp(const char *regex, int eflags);
void parse_syntax(char *ptr); void parse_syntax(char *ptr);
void parse_include(char *ptr); void parse_includes(char *ptr);
short color_to_short(const char *colorname, bool *bright); short color_to_short(const char *colorname, bool *bright);
void parse_colors(char *ptr, bool icase); void parse_colors(char *ptr, bool icase);
bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright); bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright);

View File

@ -514,10 +514,9 @@ void parse_binding(char *ptr, bool dobind)
free(keycopy); free(keycopy);
} }
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
/* Read and parse additional syntax files. */ /* Read and parse one included syntax file. */
static void _parse_include(char *file) static void parse_one_include(char *file)
{ {
struct stat rcinfo; struct stat rcinfo;
FILE *rcstream; FILE *rcstream;
@ -555,7 +554,8 @@ static void _parse_include(char *file)
parse_rcfile(rcstream, TRUE); parse_rcfile(rcstream, TRUE);
} }
void parse_include(char *ptr) /* Expand globs in the passed name, and parse the resultant files. */
void parse_includes(char *ptr)
{ {
char *option, *nanorc_save = nanorc, *expanded; char *option, *nanorc_save = nanorc, *expanded;
size_t lineno_save = lineno, i; size_t lineno_save = lineno, i;
@ -571,16 +571,15 @@ void parse_include(char *ptr)
if (glob(expanded, GLOB_ERR|GLOB_NOSORT, NULL, &files) == 0) { if (glob(expanded, GLOB_ERR|GLOB_NOSORT, NULL, &files) == 0) {
for (i = 0; i < files.gl_pathc; ++i) for (i = 0; i < files.gl_pathc; ++i)
_parse_include(files.gl_pathv[i]); parse_one_include(files.gl_pathv[i]);
} else { } else
rcfile_error(_("Error expanding %s: %s"), option, rcfile_error(_("Error expanding %s: %s"), option,
strerror(errno)); strerror(errno));
}
globfree(&files); globfree(&files);
free(expanded); free(expanded);
/* We're done with the new syntax file. Restore the original /* We're done with the included file(s). Restore the original
* filename and line number position. */ * filename and line number position. */
nanorc = nanorc_save; nanorc = nanorc_save;
lineno = lineno_save; lineno = lineno_save;
@ -995,7 +994,7 @@ void parse_rcfile(FILE *rcstream
rcfile_error(N_("Command \"%s\" not allowed in included file"), rcfile_error(N_("Command \"%s\" not allowed in included file"),
keyword); keyword);
else else
parse_include(ptr); parse_includes(ptr);
} else if (strcasecmp(keyword, "syntax") == 0) { } else if (strcasecmp(keyword, "syntax") == 0) {
if (opensyntax && endcolor == NULL) if (opensyntax && endcolor == NULL)
rcfile_error(N_("Syntax \"%s\" has no color commands"), rcfile_error(N_("Syntax \"%s\" has no color commands"),