aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tinfo/comp_error.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-05-21 05:30:25 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-05-21 05:30:25 +0000
commit39f2269fcb4873fd97d70af944ec49f4230fadea (patch)
treebd986d58f5a6e348466b5362637ba93e6cd5bf8c /contrib/ncurses/ncurses/tinfo/comp_error.c
parent7e6a63408cfb0b48f0e41f77ed82f5d0ca60bda5 (diff)
downloadsrc-39f2269fcb4873fd97d70af944ec49f4230fadea.tar.gz
src-39f2269fcb4873fd97d70af944ec49f4230fadea.zip
Import ncurses-5.2-20020518 onto the vendor branch.
Obtained from: ftp://dickey.his.com/ncurses/
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=97049
Diffstat (limited to 'contrib/ncurses/ncurses/tinfo/comp_error.c')
-rw-r--r--contrib/ncurses/ncurses/tinfo/comp_error.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/comp_error.c b/contrib/ncurses/ncurses/tinfo/comp_error.c
index a39de8114de2..e67cb795dd33 100644
--- a/contrib/ncurses/ncurses/tinfo/comp_error.c
+++ b/contrib/ncurses/ncurses/tinfo/comp_error.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998,1999,2000,2001 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 *
@@ -40,16 +40,14 @@
#include <tic.h>
-MODULE_ID("$Id: comp_error.c,v 1.21 2000/12/10 02:55:07 tom Exp $")
+MODULE_ID("$Id: comp_error.c,v 1.23 2001/09/23 00:58:30 tom Exp $")
NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings = FALSE;
-NCURSES_EXPORT_VAR(int)
-_nc_curr_line = 0; /* current line # in input */
-NCURSES_EXPORT_VAR(int)
-_nc_curr_col = 0; /* current column # in input */
+NCURSES_EXPORT_VAR(int) _nc_curr_line = 0; /* current line # in input */
+NCURSES_EXPORT_VAR(int) _nc_curr_col = 0; /* current column # in input */
- static const char *sourcename;
- static char termtype[MAX_NAME_SIZE + 1];
+static const char *sourcename;
+static char *termtype;
NCURSES_EXPORT(void)
_nc_set_source(const char *const name)
@@ -60,15 +58,17 @@ _nc_set_source(const char *const name)
NCURSES_EXPORT(void)
_nc_set_type(const char *const name)
{
+ if (termtype == 0)
+ termtype = _nc_doalloc(termtype, MAX_NAME_SIZE + 1);
termtype[0] = '\0';
if (name)
- strncat(termtype, name, sizeof(termtype) - 1);
+ strncat(termtype, name, MAX_NAME_SIZE);
}
NCURSES_EXPORT(void)
_nc_get_type(char *name)
{
- strcpy(name, termtype);
+ strcpy(name, termtype != 0 ? termtype : "");
}
static inline void
@@ -79,7 +79,7 @@ where_is_problem(void)
fprintf(stderr, ", line %d", _nc_curr_line);
if (_nc_curr_col >= 0)
fprintf(stderr, ", col %d", _nc_curr_col);
- if (termtype[0])
+ if (termtype != 0 && termtype[0] != '\0')
fprintf(stderr, ", terminal '%s'", termtype);
fputc(':', stderr);
fputc(' ', stderr);