summaryrefslogtreecommitdiff
path: root/lib/libcurses/trace/lib_trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcurses/trace/lib_trace.c')
-rw-r--r--lib/libcurses/trace/lib_trace.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libcurses/trace/lib_trace.c b/lib/libcurses/trace/lib_trace.c
index 141d7030c19..0eab5abfb93 100644
--- a/lib/libcurses/trace/lib_trace.c
+++ b/lib/libcurses/trace/lib_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_trace.c,v 1.4 2000/03/10 01:35:05 millert Exp $ */
+/* $OpenBSD: lib_trace.c,v 1.5 2000/04/04 16:49:59 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -42,7 +42,7 @@
#include <ctype.h>
-MODULE_ID("$From: lib_trace.c,v 1.33 2000/02/13 01:01:55 tom Exp $")
+MODULE_ID("$From: lib_trace.c,v 1.34 2000/04/01 20:25:47 tom Exp $")
unsigned _nc_tracing = 0; /* always define this */
@@ -51,12 +51,10 @@ const char *_nc_tputs_trace = "";
long _nc_outchars = 0;
static FILE *tracefp; /* default to writing to stderr */
-#endif
void
trace(const unsigned int tracelevel GCC_UNUSED)
{
-#ifdef TRACE
static bool been_here = FALSE;
static char my_name[] = "trace";
@@ -81,8 +79,8 @@ trace(const unsigned int tracelevel GCC_UNUSED)
_tracef("TRACING NCURSES version %s (%d)",
NCURSES_VERSION, NCURSES_VERSION_PATCH);
}
-#endif
}
+#endif
const char *
_nc_visbuf2(int bufnum, const char *buf)
@@ -97,7 +95,15 @@ _nc_visbuf2(int bufnum, const char *buf)
if (buf == CANCELLED_STRING)
return ("(cancelled)");
+#ifdef TRACE
tp = vbuf = _nc_trace_buf(bufnum, (strlen(buf) * 4) + 5);
+#else
+ {
+ static char *mybuf[2];
+ mybuf[bufnum] = _nc_doalloc(mybuf[bufnum], (strlen(buf) * 4) + 5);
+ tp = vbuf = mybuf[bufnum];
+ }
+#endif
*tp++ = '"';
while ((c = *buf++) != '\0') {
if (c == '"') {