aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-06-20 19:42:51 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-06-20 19:42:51 +0000
commitb82face19ffe7bbde78f772e93cf2d0d9f42fbdf (patch)
tree91a3f3ec93c8c476cbd12ad790a9ed6ab430d4e3 /contrib/ncurses/ncurses
parent3badd6bcab72af1619f1e9694025996b49c5df61 (diff)
downloadsrc-b82face19ffe7bbde78f772e93cf2d0d9f42fbdf.tar.gz
src-b82face19ffe7bbde78f772e93cf2d0d9f42fbdf.zip
Import ncurses 5.2-20020615 to fix a first-column display bug.vendor/ncurses/5.2-20020615
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=98503 svn path=/vendor/ncurses/5.2-20020615/; revision=98505; tag=vendor/ncurses/5.2-20020615
Diffstat (limited to 'contrib/ncurses/ncurses')
-rw-r--r--contrib/ncurses/ncurses/base/MKkeyname.awk10
-rw-r--r--contrib/ncurses/ncurses/base/lib_getch.c4
-rw-r--r--contrib/ncurses/ncurses/base/lib_pad.c35
-rw-r--r--contrib/ncurses/ncurses/base/lib_set_term.c22
-rw-r--r--contrib/ncurses/ncurses/curses.priv.h4
-rw-r--r--contrib/ncurses/ncurses/tinfo/lib_termcap.c6
-rw-r--r--contrib/ncurses/ncurses/tinfo/lib_ttyflags.c8
-rw-r--r--contrib/ncurses/ncurses/tinfo/parse_entry.c4
-rw-r--r--contrib/ncurses/ncurses/trace/lib_traceatr.c63
-rw-r--r--contrib/ncurses/ncurses/trace/lib_tracebits.c34
-rw-r--r--contrib/ncurses/ncurses/trace/lib_tracechr.c10
-rw-r--r--contrib/ncurses/ncurses/trace/varargs.c7
12 files changed, 116 insertions, 91 deletions
diff --git a/contrib/ncurses/ncurses/base/MKkeyname.awk b/contrib/ncurses/ncurses/base/MKkeyname.awk
index 5aab9369857c..b8cd5da256a2 100644
--- a/contrib/ncurses/ncurses/base/MKkeyname.awk
+++ b/contrib/ncurses/ncurses/base/MKkeyname.awk
@@ -1,4 +1,4 @@
-# $Id: MKkeyname.awk,v 1.21 2002/02/23 22:36:33 tom Exp $
+# $Id: MKkeyname.awk,v 1.22 2002/05/25 22:25:06 tom Exp $
##############################################################################
# Copyright (c) 1999-2001,2002 Free Software Foundation, Inc. #
# #
@@ -49,10 +49,12 @@ END {
print "char name[20];"
print "char *p;"
print ""
+ print "\tif (c == -1) return \"-1\";"
+ print ""
print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)"
print "\t\tif (_nc_key_names[i].code == c)"
print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;"
- print "\tif (c >= 256) return \"UNKNOWN KEY\";"
+ print "\tif (c < 0 || c >= 256) return \"UNKNOWN KEY\";"
print ""
print "\tif (table == 0)"
print "\t\ttable = typeCalloc(char *, 256);"
@@ -66,9 +68,7 @@ END {
print "\t\t\tp += 2;"
print "\t\t\tc -= 128;"
print "\t\t}"
- print "\t\tif (c < 0)"
- print "\t\t\tsprintf(p, \"%d\", c);"
- print "\t\telse if (c < 32)"
+ print "\t\tif (c < 32)"
print "\t\t\tsprintf(p, \"^%c\", c + '@');"
print "\t\telse if (c == 127)"
print "\t\t\tstrcpy(p, \"^?\");"
diff --git a/contrib/ncurses/ncurses/base/lib_getch.c b/contrib/ncurses/ncurses/base/lib_getch.c
index f4ecbdafe2ae..af1be33a18d5 100644
--- a/contrib/ncurses/ncurses/base/lib_getch.c
+++ b/contrib/ncurses/ncurses/base/lib_getch.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.60 2002/03/17 00:46:01 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.61 2002/06/16 00:31:57 tom Exp $")
#include <fifo_defs.h>
@@ -260,7 +260,7 @@ _nc_wgetch(WINDOW *win, unsigned long *result, int use_meta)
/* resizeterm can push KEY_RESIZE */
if (cooked_key_in_fifo()) {
*result = fifo_pull();
- returnCode(OK);
+ returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
}
}
#endif
diff --git a/contrib/ncurses/ncurses/base/lib_pad.c b/contrib/ncurses/ncurses/base/lib_pad.c
index 556fb19e6993..83983c3bbd1c 100644
--- a/contrib/ncurses/ncurses/base/lib_pad.c
+++ b/contrib/ncurses/ncurses/base/lib_pad.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_pad.c,v 1.36 2002/05/18 21:28:44 Kriang.Lerdsuwanakij Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.37 2002/05/23 23:39:26 tom Exp $")
NCURSES_EXPORT(WINDOW *)
newpad(int l, int c)
@@ -193,24 +193,21 @@ pnoutrefresh
i++, m++) {
register struct ldat *nline = &newscr->_line[m];
register struct ldat *oline = &win->_line[i];
- NCURSES_CH_T ch;
-
- /*
- * Special case for leftmost character of the displayed area.
- * Only half of a double-width character may be visible.
- */
- ch = oline->text[pmincol];
- if_WIDEC(isnac(ch)) {
- SetChar(ch, L(' '), AttrOf(oline->text[pmincol - 1]));
- }
- if (!CharEq(ch, nline->text[smincol])) {
- nline->text[smincol] = ch;
- CHANGED_CELL(nline, smincol);
- }
-
- for (j = pmincol + 1, n = smincol + 1; j <= pmaxcol; j++, n++) {
- if (!CharEq(oline->text[j], nline->text[n])) {
- nline->text[n] = oline->text[j];
+ for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
+ NCURSES_CH_T ch = oline->text[j];
+#if USE_WIDEC_SUPPORT
+ /*
+ * Special case for leftmost character of the displayed area.
+ * Only half of a double-width character may be visible.
+ */
+ if (j == pmincol
+ && j > 0
+ && isnac(ch)) {
+ SetChar(ch, L(' '), AttrOf(oline->text[j - 1]));
+ }
+#endif
+ if (!CharEq(ch, nline->text[n])) {
+ nline->text[n] = ch;
CHANGED_CELL(nline, n);
}
}
diff --git a/contrib/ncurses/ncurses/base/lib_set_term.c b/contrib/ncurses/ncurses/base/lib_set_term.c
index 03bb5bfaaac2..f3940fa03c1c 100644
--- a/contrib/ncurses/ncurses/base/lib_set_term.c
+++ b/contrib/ncurses/ncurses/base/lib_set_term.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -43,7 +43,7 @@
#include <term.h> /* cur_term */
#include <tic.h>
-MODULE_ID("$Id: lib_set_term.c,v 1.64 2002/02/10 00:21:10 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.65 2002/06/15 18:40:20 tom Exp $")
NCURSES_EXPORT(SCREEN *)
set_term(SCREEN * screenp)
@@ -181,7 +181,7 @@ extract_fgbg(char *src, int *result)
if (dst == 0) {
dst = src;
} else if (value >= 0) {
- *result = value % max_colors;
+ *result = value;
}
while (*dst != 0 && *dst != ';')
dst++;
@@ -275,6 +275,22 @@ _nc_setupscreen
p = extract_fgbg(p, &(SP->_default_bg));
TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
SP->_default_fg, SP->_default_bg));
+ if (SP->_default_fg > max_colors) {
+ if (set_a_foreground != ABSENT_STRING
+ && !strcmp(set_a_foreground, "\033[3%p1%dm")) {
+ set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m";
+ } else {
+ SP->_default_fg %= max_colors;
+ }
+ }
+ if (SP->_default_bg > max_colors) {
+ if (set_a_background != ABSENT_STRING
+ && !strcmp(set_a_background, "\033[4%p1%dm")) {
+ set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m";
+ } else {
+ SP->_default_bg %= max_colors;
+ }
+ }
}
#endif
#endif /* NCURSES_EXT_FUNCS */
diff --git a/contrib/ncurses/ncurses/curses.priv.h b/contrib/ncurses/ncurses/curses.priv.h
index d901eca7f3ae..97582786d04a 100644
--- a/contrib/ncurses/ncurses/curses.priv.h
+++ b/contrib/ncurses/ncurses/curses.priv.h
@@ -34,7 +34,7 @@
/*
- * $Id: curses.priv.h,v 1.218 2002/05/18 19:48:38 tom Exp $
+ * $Id: curses.priv.h,v 1.219 2002/05/25 12:22:43 tom Exp $
*
* curses.priv.h
*
@@ -248,6 +248,7 @@ color_t;
#endif
#include <curses.h> /* we'll use -Ipath directive to get the right one! */
+#include <term.h>
struct ldat
{
@@ -672,6 +673,7 @@ extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *);
extern NCURSES_EXPORT(attr_t) _nc_retrace_attr_t (attr_t);
extern NCURSES_EXPORT(attr_t) _nc_retrace_chtype (chtype);
extern NCURSES_EXPORT(char *) _nc_retrace_ptr (char *);
+extern NCURSES_EXPORT(char *) _nc_trace_ttymode(TTY *tty);
extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list);
extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype);
extern NCURSES_EXPORT(int) _nc_retrace_int (int);
diff --git a/contrib/ncurses/ncurses/tinfo/lib_termcap.c b/contrib/ncurses/ncurses/tinfo/lib_termcap.c
index c647b9730a58..c03a601f4968 100644
--- a/contrib/ncurses/ncurses/tinfo/lib_termcap.c
+++ b/contrib/ncurses/ncurses/tinfo/lib_termcap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -34,16 +34,16 @@
* Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) *
****************************************************************************/
+#define __INTERNAL_CAPS_VISIBLE
#include <curses.priv.h>
#include <termcap.h>
#include <tic.h>
#include <ctype.h>
-#define __INTERNAL_CAPS_VISIBLE
#include <term_entry.h>
-MODULE_ID("$Id: lib_termcap.c,v 1.42 2001/09/22 19:17:31 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.43 2002/05/25 12:24:13 tom Exp $")
#define CSI 233
#define ESC 033 /* ^[ */
diff --git a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c
index e71be893fbb9..385166e94fa7 100644
--- a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c
+++ b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -38,7 +38,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_ttyflags.c,v 1.6 2001/12/16 01:19:01 tom Exp $")
+MODULE_ID("$Id: lib_ttyflags.c,v 1.7 2002/05/25 14:50:00 tom Exp $")
#undef tabs
@@ -62,7 +62,7 @@ _nc_get_tty_mode(TTY * buf)
if (cur_term == 0
|| GET_TTY(cur_term->Filedes, buf) != 0)
return (ERR);
- TR(TRACE_BITS, ("_nc_get_tty_mode: %s", _nc_tracebits()));
+ TR(TRACE_BITS, ("_nc_get_tty_mode: %s", _nc_trace_ttymode(buf)));
return (OK);
}
@@ -72,7 +72,7 @@ _nc_set_tty_mode(TTY * buf)
if (cur_term == 0
|| SET_TTY(cur_term->Filedes, buf) != 0)
return (ERR);
- TR(TRACE_BITS, ("_nc_set_tty_mode: %s", _nc_tracebits()));
+ TR(TRACE_BITS, ("_nc_set_tty_mode: %s", _nc_trace_ttymode(buf)));
return (OK);
}
diff --git a/contrib/ncurses/ncurses/tinfo/parse_entry.c b/contrib/ncurses/ncurses/tinfo/parse_entry.c
index 797974cb1642..1c0ce850e42d 100644
--- a/contrib/ncurses/ncurses/tinfo/parse_entry.c
+++ b/contrib/ncurses/ncurses/tinfo/parse_entry.c
@@ -40,14 +40,14 @@
* from the input stream.
*/
+#define __INTERNAL_CAPS_VISIBLE
#include <curses.priv.h>
#include <ctype.h>
#include <tic.h>
-#define __INTERNAL_CAPS_VISIBLE
#include <term_entry.h>
-MODULE_ID("$Id: parse_entry.c,v 1.55 2002/04/22 00:01:30 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.56 2002/05/25 12:23:51 tom Exp $")
#ifdef LINT
static short const parametrized[] =
diff --git a/contrib/ncurses/ncurses/trace/lib_traceatr.c b/contrib/ncurses/ncurses/trace/lib_traceatr.c
index 714e508f3040..870624f3f514 100644
--- a/contrib/ncurses/ncurses/trace/lib_traceatr.c
+++ b/contrib/ncurses/ncurses/trace/lib_traceatr.c
@@ -39,7 +39,7 @@
#include <curses.priv.h>
#include <term.h> /* acs_chars */
-MODULE_ID("$Id: lib_traceatr.c,v 1.41 2002/02/10 01:26:56 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.42 2002/06/16 00:35:01 tom Exp $")
#define COLOR_OF(c) (c < 0 || c > 7 ? "default" : colors[c].name)
@@ -249,39 +249,42 @@ NCURSES_EXPORT(char *)
_tracecchar_t2 (int bufnum, const cchar_t *ch)
{
char *buf = _nc_trace_buf(bufnum, BUFSIZ);
- attr_t attr = AttrOfD(ch);
+ attr_t attr;
const char *found;
strcpy(buf, l_brace);
- if ((found = _nc_altcharset_name(attr, CharOfD(ch))) != 0) {
- (void) strcat(buf, found);
- attr &= ~A_ALTCHARSET;
- } else if (!isnac(CHDEREF(ch))) {
- PUTC_DATA;
- int n;
-
- memset (&PUT_st, '\0', sizeof (PUT_st));
- PUTC_i = 0;
- (void) strcat(buf, "{ ");
- do {
- PUTC_ch = PUTC_i < CCHARW_MAX ? ch->chars[PUTC_i] : L'\0';
- PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
- if (PUTC_ch == L'\0')
- --PUTC_n;
- if (PUTC_n <= 0)
- break;
- for (n = 0; n < PUTC_n; n++) {
- if (n)
- (void) strcat(buf, ", ");
- (void) strcat(buf, _tracechar(UChar(PUTC_buf[n])));
- }
- ++PUTC_i;
- } while (PUTC_ch != L'\0');
- (void) strcat(buf, " }");
+ if (ch != 0) {
+ attr = AttrOfD(ch);
+ if ((found = _nc_altcharset_name(attr, CharOfD(ch))) != 0) {
+ (void) strcat(buf, found);
+ attr &= ~A_ALTCHARSET;
+ } else if (!isnac(CHDEREF(ch))) {
+ PUTC_DATA;
+ int n;
+
+ memset (&PUT_st, '\0', sizeof (PUT_st));
+ PUTC_i = 0;
+ (void) strcat(buf, "{ ");
+ do {
+ PUTC_ch = PUTC_i < CCHARW_MAX ? ch->chars[PUTC_i] : L'\0';
+ PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
+ if (PUTC_ch == L'\0')
+ --PUTC_n;
+ if (PUTC_n <= 0)
+ break;
+ for (n = 0; n < PUTC_n; n++) {
+ if (n)
+ (void) strcat(buf, ", ");
+ (void) strcat(buf, _tracechar(UChar(PUTC_buf[n])));
+ }
+ ++PUTC_i;
+ } while (PUTC_ch != L'\0');
+ (void) strcat(buf, " }");
+ }
+ if (attr != A_NORMAL)
+ (void) sprintf(buf + strlen(buf), " | %s",
+ _traceattr2(bufnum + 20, attr));
}
- if (attr != A_NORMAL)
- (void) sprintf(buf + strlen(buf), " | %s",
- _traceattr2(bufnum + 20, attr));
return (strcat(buf, r_brace));
}
diff --git a/contrib/ncurses/ncurses/trace/lib_tracebits.c b/contrib/ncurses/ncurses/trace/lib_tracebits.c
index a2153d496aa6..e681862649af 100644
--- a/contrib/ncurses/ncurses/trace/lib_tracebits.c
+++ b/contrib/ncurses/ncurses/trace/lib_tracebits.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -34,7 +34,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_tracebits.c,v 1.11 2001/10/20 22:44:32 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.12 2002/05/25 14:35:07 tom Exp $")
#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
@@ -82,7 +82,7 @@ lookup_bits(char *buf, const BITNAMES * table, const char *label, unsigned int v
}
NCURSES_EXPORT(char *)
-_nc_tracebits(void)
+_nc_trace_ttymode(TTY * tty)
/* describe the state of the terminal control bits exactly */
{
char *buf;
@@ -143,14 +143,14 @@ _nc_tracebits(void)
8 + sizeof(lflags) +
8);
- if (cur_term->Nttyb.c_iflag & ALLIN)
- lookup_bits(buf, iflags, "iflags", cur_term->Nttyb.c_iflag);
+ if (tty->c_iflag & ALLIN)
+ lookup_bits(buf, iflags, "iflags", tty->c_iflag);
- if (cur_term->Nttyb.c_oflag & ALLOUT)
- lookup_bits(buf, oflags, "oflags", cur_term->Nttyb.c_oflag);
+ if (tty->c_oflag & ALLOUT)
+ lookup_bits(buf, oflags, "oflags", tty->c_oflag);
- if (cur_term->Nttyb.c_cflag & ALLCTRL)
- lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.c_cflag);
+ if (tty->c_cflag & ALLCTRL)
+ lookup_bits(buf, cflags, "cflags", tty->c_cflag);
#if defined(CS5) && defined(CS8)
{
@@ -176,7 +176,7 @@ _nc_tracebits(void)
},
};
const char *result = "CSIZE? ";
- int value = (cur_term->Nttyb.c_cflag & CSIZE);
+ int value = (tty->c_cflag & CSIZE);
unsigned n;
if (value != 0) {
@@ -191,8 +191,8 @@ _nc_tracebits(void)
}
#endif
- if (cur_term->Nttyb.c_lflag & ALLLOCAL)
- lookup_bits(buf, lflags, "lflags", cur_term->Nttyb.c_lflag);
+ if (tty->c_lflag & ALLLOCAL)
+ lookup_bits(buf, lflags, "lflags", tty->c_lflag);
#else
/* reference: ttcompat(4M) on SunOS 4.1 */
@@ -231,12 +231,18 @@ _nc_tracebits(void)
buf = _nc_trace_buf(0,
8 + sizeof(cflags));
- if (cur_term->Nttyb.sg_flags & ALLCTRL) {
- lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.sg_flags);
+ if (tty->sg_flags & ALLCTRL) {
+ lookup_bits(buf, cflags, "cflags", tty->sg_flags);
}
#endif
return (buf);
}
+
+NCURSES_EXPORT(char *)
+_nc_tracebits(void)
+{
+ return _nc_trace_ttymode(&(cur_term->Nttyb));
+}
#else
empty_module(_nc_tracebits)
#endif /* TRACE */
diff --git a/contrib/ncurses/ncurses/trace/lib_tracechr.c b/contrib/ncurses/ncurses/trace/lib_tracechr.c
index 5b7c90c74587..2f33391b5505 100644
--- a/contrib/ncurses/ncurses/trace/lib_tracechr.c
+++ b/contrib/ncurses/ncurses/trace/lib_tracechr.c
@@ -36,7 +36,7 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_tracechr.c,v 1.8 2002/02/10 01:26:04 tom Exp $")
+MODULE_ID("$Id: lib_tracechr.c,v 1.9 2002/05/25 23:34:19 tom Exp $")
#ifdef TRACE
NCURSES_EXPORT(char *)
@@ -44,10 +44,10 @@ _tracechar(int ch)
{
static char crep[40];
(void) sprintf(crep, "'%.30s' = %#03o",
- (ch > KEY_MIN)
- ? keyname(ch)
- : unctrl(ch),
- (unsigned) ch);
+ ((ch > KEY_MIN || ch < 0)
+ ? keyname(ch)
+ : unctrl(ch)),
+ ch);
return (crep);
}
#else
diff --git a/contrib/ncurses/ncurses/trace/varargs.c b/contrib/ncurses/ncurses/trace/varargs.c
index 7a1a7424fe09..7bcb7b55d42c 100644
--- a/contrib/ncurses/ncurses/trace/varargs.c
+++ b/contrib/ncurses/ncurses/trace/varargs.c
@@ -34,7 +34,7 @@
#include <ctype.h>
-MODULE_ID("$Id: varargs.c,v 1.1 2001/10/20 20:37:48 tom Exp $")
+MODULE_ID("$Id: varargs.c,v 1.2 2002/06/01 16:16:00 tom Exp $")
#ifdef TRACE
@@ -53,17 +53,18 @@ typedef enum {
NCURSES_EXPORT(char *)
_nc_varargs(const char *fmt, va_list ap)
{
+ static char dummy[] = "";
static char *result_buf;
static size_t result_len;
char buffer[BUFSIZ];
if (fmt == 0 || *fmt == '\0')
- return "";
+ return dummy;
if (result_len == 0)
result_buf = typeMalloc(char, result_len = BUFSIZ);
if (result_buf == 0)
- return "";
+ return dummy;
*result_buf = '\0';
while (*fmt != '\0') {