aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/tinfo/lib_termname.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/tinfo/lib_termname.c')
-rw-r--r--contrib/ncurses/ncurses/tinfo/lib_termname.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/lib_termname.c b/contrib/ncurses/ncurses/tinfo/lib_termname.c
index 57ce807a9e5f..713d0be8c360 100644
--- a/contrib/ncurses/ncurses/tinfo/lib_termname.c
+++ b/contrib/ncurses/ncurses/tinfo/lib_termname.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2003 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 *
@@ -27,22 +27,18 @@
****************************************************************************/
#include <curses.priv.h>
-#include <tic.h> /* for MAX_ALIAS */
-MODULE_ID("$Id: lib_termname.c,v 1.7 2001/08/04 19:29:38 tom Exp $")
+MODULE_ID("$Id: lib_termname.c,v 1.8 2003/12/27 18:23:01 tom Exp $")
NCURSES_EXPORT(char *)
termname(void)
{
- char *name = getenv("TERM");
- static char ret[MAX_ALIAS + 1];
+ char *name = 0;
T((T_CALLED("termname()")));
- if (name != 0) {
- ret[0] = '\0';
- (void) strncat(ret, name, sizeof(ret) - 1);
- name = ret;
- }
+ if (cur_term != 0)
+ name = cur_term->_termname;
+
returnPtr(name);
}