replace for loop for hline init with memset in init functions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@501 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
17276e506e
commit
0a06e07831
|
@ -21,6 +21,8 @@ General
|
||||||
- Added restoration of totsize after unjustify command.
|
- Added restoration of totsize after unjustify command.
|
||||||
usage()
|
usage()
|
||||||
- Add arg to -T help (Rocco).
|
- Add arg to -T help (Rocco).
|
||||||
|
global_init(), handle_sigwinch()
|
||||||
|
- Messy loops replaced with memset calls (Rocco).
|
||||||
|
|
||||||
nano 0.9.99pre1 - 01/17/2001
|
nano 0.9.99pre1 - 01/17/2001
|
||||||
General
|
General
|
||||||
|
|
19
nano.c
19
nano.c
|
@ -167,8 +167,6 @@ void clear_filename(void)
|
||||||
/* Initialize global variables - no better way for now */
|
/* Initialize global variables - no better way for now */
|
||||||
void global_init(void)
|
void global_init(void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
current_x = 0;
|
current_x = 0;
|
||||||
current_y = 0;
|
current_y = 0;
|
||||||
|
|
||||||
|
@ -190,11 +188,8 @@ void global_init(void)
|
||||||
die_too_small();
|
die_too_small();
|
||||||
|
|
||||||
hblank = nmalloc(COLS + 1);
|
hblank = nmalloc(COLS + 1);
|
||||||
|
memset(hblank, ' ', COLS);
|
||||||
/* Thanks BG for this bit... */
|
hblank[COLS] = 0;
|
||||||
for (i = 0; i <= COLS - 1; i++)
|
|
||||||
hblank[i] = ' ';
|
|
||||||
hblank[i] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_HELP
|
#ifndef DISABLE_HELP
|
||||||
|
@ -1543,7 +1538,6 @@ void handle_sigwinch(int s)
|
||||||
char *tty = NULL;
|
char *tty = NULL;
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
int i = 0;
|
|
||||||
struct winsize win;
|
struct winsize win;
|
||||||
|
|
||||||
tty = ttyname(0);
|
tty = ttyname(0);
|
||||||
|
@ -1566,12 +1560,9 @@ void handle_sigwinch(int s)
|
||||||
if ((fill = COLS - CHARS_FROM_EOL) < MIN_FILL_LENGTH)
|
if ((fill = COLS - CHARS_FROM_EOL) < MIN_FILL_LENGTH)
|
||||||
die_too_small();
|
die_too_small();
|
||||||
|
|
||||||
free(hblank);
|
hblank = nrealloc(hblank, COLS + 1);
|
||||||
hblank = nmalloc(COLS + 1);
|
memset(hblank, ' ', COLS);
|
||||||
|
hblank[COLS] = 0;
|
||||||
for (i = 0; i <= COLS - 1; i++)
|
|
||||||
hblank[i] = ' ';
|
|
||||||
hblank[i] = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_NCURSES_H
|
#ifdef HAVE_NCURSES_H
|
||||||
resizeterm(LINES, COLS);
|
resizeterm(LINES, COLS);
|
||||||
|
|
Loading…
Reference in New Issue