projects
/
ncurses.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ncurses 5.7 - patch 20101204
[ncurses.git]
/
ncurses
/
tinfo
/
lib_longname.c
diff --git
a/ncurses/tinfo/lib_longname.c
b/ncurses/tinfo/lib_longname.c
index 746f83f4eabf6cc3edbf93783815d370e1ec8d44..2164a126ca8b95a3395db56f2e2e6cfb81595205 100644
(file)
--- a/
ncurses/tinfo/lib_longname.c
+++ b/
ncurses/tinfo/lib_longname.c
@@
-42,20
+42,27
@@
#include <curses.priv.h>
#include <curses.priv.h>
-MODULE_ID("$Id: lib_longname.c,v 1.1
0 2009/02/15 00:48:15
tom Exp $")
+MODULE_ID("$Id: lib_longname.c,v 1.1
1 2009/02/21 17:18:02
tom Exp $")
+#if USE_REENTRANT
NCURSES_EXPORT(char *)
NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0)
{
NCURSES_EXPORT(char *)
NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0)
{
+ static char empty[] =
+ {'\0'};
char *ptr;
char *ptr;
- T((T_CALLED("longname(
)")
));
+ T((T_CALLED("longname(
%p)"), SP_PARM
));
- for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--)
- if (*ptr == '|')
- returnPtr(ptr + 1);
-
- returnPtr(ttytype);
+ if (SP_PARM) {
+ for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype);
+ ptr > SP_PARM->_ttytype;
+ ptr--)
+ if (*ptr == '|')
+ returnPtr(ptr + 1);
+ returnPtr(SP_PARM->_ttytype);
+ }
+ return empty;
}
#if NCURSES_SP_FUNCS
}
#if NCURSES_SP_FUNCS
@@
-65,3
+72,20
@@
longname(void)
return NCURSES_SP_NAME(longname) (CURRENT_SCREEN);
}
#endif
return NCURSES_SP_NAME(longname) (CURRENT_SCREEN);
}
#endif
+
+#else
+NCURSES_EXPORT(char *)
+longname(void)
+{
+ char *ptr;
+
+ T((T_CALLED("longname()")));
+
+ for (ptr = ttytype + strlen(ttytype);
+ ptr > ttytype;
+ ptr--)
+ if (*ptr == '|')
+ returnPtr(ptr + 1);
+ returnPtr(ttytype);
+}
+#endif