Renaming a variable, and eliding another.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4866 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
d2f3f2194e
Коммит
6a007a92c9
@ -18,6 +18,7 @@
|
||||
* doc/syntax/{man,python,fortran}.nanorc: Add regexes for comments,
|
||||
trailing whitespace and reminders, and trim some trailing spaces.
|
||||
* src/rcfile.c: Move parse_magic_exp() next to its sister.
|
||||
* src/color.c (color_update): Rename a variable, and elide another.
|
||||
|
||||
2014-05-10 Chris Allegretta <chrisa@asty.org>
|
||||
* src/rcfile.c (parse_color_names): Redefine false and true to
|
||||
|
17
src/color.c
17
src/color.c
@ -158,10 +158,9 @@ void color_update(void)
|
||||
/* Var magicstring will stay NULL if we fail to get a magic result. */
|
||||
#ifdef HAVE_LIBMAGIC
|
||||
const char *magicstring = NULL;
|
||||
const char *magicerr = NULL;
|
||||
magic_t m;
|
||||
magic_t cookie;
|
||||
struct stat fileinfo;
|
||||
#endif /* HAVE_LIBMAGIC */
|
||||
#endif
|
||||
|
||||
assert(openfile != NULL);
|
||||
|
||||
@ -189,21 +188,21 @@ void color_update(void)
|
||||
|
||||
#ifdef HAVE_LIBMAGIC
|
||||
if (stat(openfile->filename, &fileinfo) == 0) {
|
||||
m = magic_open(MAGIC_SYMLINK |
|
||||
cookie = magic_open(MAGIC_SYMLINK |
|
||||
#ifdef DEBUG
|
||||
MAGIC_DEBUG | MAGIC_CHECK |
|
||||
#endif
|
||||
MAGIC_ERROR);
|
||||
if (m == NULL || magic_load(m, NULL) < 0)
|
||||
if (cookie == NULL || magic_load(cookie, NULL) < 0)
|
||||
statusbar(_("magic_load() failed: %s"), strerror(errno));
|
||||
else {
|
||||
magicstring = magic_file(m,openfile->filename);
|
||||
magicstring = magic_file(cookie, openfile->filename);
|
||||
if (magicstring == NULL) {
|
||||
magicerr = magic_error(m);
|
||||
statusbar(_("magic_file(%s) failed: %s"), openfile->filename, magicerr);
|
||||
statusbar(_("magic_file(%s) failed: %s"),
|
||||
openfile->filename, magic_error(cookie));
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "magic string returned: %s\n", magicstring);
|
||||
fprintf(stderr, "Returned magic string is: %s\n", magicstring);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user