Commit 6a007a92 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Renaming a variable, and eliding another.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4866 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent d2f3f219
Showing with 9 additions and 9 deletions
+9 -9
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* doc/syntax/{man,python,fortran}.nanorc: Add regexes for comments, * doc/syntax/{man,python,fortran}.nanorc: Add regexes for comments,
trailing whitespace and reminders, and trim some trailing spaces. trailing whitespace and reminders, and trim some trailing spaces.
* src/rcfile.c: Move parse_magic_exp() next to its sister. * 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> 2014-05-10 Chris Allegretta <chrisa@asty.org>
* src/rcfile.c (parse_color_names): Redefine false and true to * src/rcfile.c (parse_color_names): Redefine false and true to
......
...@@ -158,10 +158,9 @@ void color_update(void) ...@@ -158,10 +158,9 @@ void color_update(void)
/* Var magicstring will stay NULL if we fail to get a magic result. */ /* Var magicstring will stay NULL if we fail to get a magic result. */
#ifdef HAVE_LIBMAGIC #ifdef HAVE_LIBMAGIC
const char *magicstring = NULL; const char *magicstring = NULL;
const char *magicerr = NULL; magic_t cookie;
magic_t m;
struct stat fileinfo; struct stat fileinfo;
#endif /* HAVE_LIBMAGIC */ #endif
assert(openfile != NULL); assert(openfile != NULL);
...@@ -189,21 +188,21 @@ void color_update(void) ...@@ -189,21 +188,21 @@ void color_update(void)
#ifdef HAVE_LIBMAGIC #ifdef HAVE_LIBMAGIC
if (stat(openfile->filename, &fileinfo) == 0) { if (stat(openfile->filename, &fileinfo) == 0) {
m = magic_open(MAGIC_SYMLINK | cookie = magic_open(MAGIC_SYMLINK |
#ifdef DEBUG #ifdef DEBUG
MAGIC_DEBUG | MAGIC_CHECK | MAGIC_DEBUG | MAGIC_CHECK |
#endif #endif
MAGIC_ERROR); 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)); statusbar(_("magic_load() failed: %s"), strerror(errno));
else { else {
magicstring = magic_file(m,openfile->filename); magicstring = magic_file(cookie, openfile->filename);
if (magicstring == NULL) { if (magicstring == NULL) {
magicerr = magic_error(m); statusbar(_("magic_file(%s) failed: %s"),
statusbar(_("magic_file(%s) failed: %s"), openfile->filename, magicerr); openfile->filename, magic_error(cookie));
} }
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "magic string returned: %s\n", magicstring); fprintf(stderr, "Returned magic string is: %s\n", magicstring);
#endif #endif
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment