- nano.c:main() - Silence annoying compiler messages about clobbering and uninitialized variables by moving variable inits to the top of main() and re-initializing them after the sigsetjmp()

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1456 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2003-02-13 00:52:49 +00:00
parent a0449d92a0
commit fe1d0722d4
2 changed files with 13 additions and 5 deletions

View File

@ -15,8 +15,7 @@ CVS code
nano.c:do_spell(), and search.c:do_replace() (David Benbennick).
- Change various const char *s to char *s because Irix curses
waddnstr() complains about const char's, I imagine this is a
common System V curses issue.
common System V curses issue.
- files.c:
cwd_tab_completion()
- Memory leak fix (David Benbennick).
@ -46,6 +45,9 @@ CVS code
main()
- Fix nano not compiling with ENABLE_RCFILE and DISABLE_TABCOMP
(David Benbennick).
- Silence annoying compiler messages about clobbering and
uninitialized variables by moving variable inits to the top
of main() and re-initializing them after the sigsetjmp().
- rcfile.c:
colortoint()
- Don't bomb after invalid color and print bad color name

12
nano.c
View File

@ -3019,9 +3019,12 @@ int main(int argc, char *argv[])
{
int optchr;
int startline = 0; /* Line to try and start at */
int modify_control_seq;
int modify_control_seq = 0;
int fill_flag_used = 0; /* Was the fill option used? */
const shortcut *s;
int keyhandled = 0; /* Have we handled the keystroke yet? */
int kbinput = -1; /* Input from keyboard */
#ifdef HAVE_GETOPT_LONG
int preserveopt = 0; /* Did the cmdline include --preserve? */
#endif
@ -3471,6 +3474,11 @@ int main(int argc, char *argv[])
/* Return here after a sigwinch */
sigsetjmp(jmpbuf, 1);
/* SHUT UP GCC! */
startline = 0;
fill_flag_used = 0;
keyhandled = 0;
/* This variable should be initialized after the sigsetjmp(), so we
can't do Esc-Esc then quickly resize and muck things up. */
modify_control_seq = 0;
@ -3479,8 +3487,6 @@ int main(int argc, char *argv[])
reset_cursor();
while (1) {
int keyhandled = 0; /* Have we handled the keystroke yet? */
int kbinput; /* Input from keyboard */
if (ISSET(CONSTUPDATE))
do_cursorpos(1);