diff options
author | Ron Yorston | 2019-04-03 08:56:30 +0100 |
---|---|---|
committer | Denys Vlasenko | 2019-04-03 16:20:13 +0200 |
commit | 3e61b59ef326cdb800736f502e0240b109271076 (patch) | |
tree | aeb26998dfb89712345341e79149d61310b5debf | |
parent | 2f28b2bdbbe229b760e7c2a271d73a19f929ca76 (diff) | |
download | busybox-3e61b59ef326cdb800736f502e0240b109271076.zip busybox-3e61b59ef326cdb800736f502e0240b109271076.tar.gz |
vi: avoid build failure in non-default case
If vi is built with FEATURE_VI_USE_SIGNALS disabled and
FEATURE_VI_WIN_RESIZE enabled new_screen() is used without a
declaration. Move the function to avoid this.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/vi.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/editors/vi.c b/editors/vi.c index b41cf45..ce261fe 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -722,6 +722,22 @@ static void screen_erase(void) memset(screen, ' ', screensize); // clear new screen } +static char *new_screen(int ro, int co) +{ + int li; + + free(screen); + screensize = ro * co + 8; + screen = xmalloc(screensize); + // initialize the new screen. assume this will be a empty file. + screen_erase(); + // non-existent text[] lines start with a tilde (~). + for (li = 1; li < ro - 1; li++) { + screen[(li * co) + 0] = '~'; + } + return screen; +} + //----- Synchronize the cursor to Dot -------------------------- static NOINLINE void sync_cursor(char *d, int *row, int *col) { @@ -2882,22 +2898,6 @@ static void colon(char *buf) // TAB NEWLINE VT FF RETURN SPACE // DO NOT COUNT NEWLINE AS WHITESPACE -static char *new_screen(int ro, int co) -{ - int li; - - free(screen); - screensize = ro * co + 8; - screen = xmalloc(screensize); - // initialize the new screen. assume this will be a empty file. - screen_erase(); - // non-existent text[] lines start with a tilde (~). - for (li = 1; li < ro - 1; li++) { - screen[(li * co) + 0] = '~'; - } - return screen; -} - static int st_test(char *p, int type, int dir, char *tested) { char c, c0, ci; |