diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-10-08 22:47:13 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-10-08 22:47:13 +0000 |
commit | 457e19a5caf834be99ae13c3efc359a02a42fb20 (patch) | |
tree | 244a1ee1210da4e47f53ccd339625b8a9f03b00e /lib/libcurses/tinfo/home_terminfo.c | |
parent | a6de1b801fa82570ef7457ae6e5188ebc7f5d93e (diff) |
update to ncurses-5.1-20001007
Diffstat (limited to 'lib/libcurses/tinfo/home_terminfo.c')
-rw-r--r-- | lib/libcurses/tinfo/home_terminfo.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/libcurses/tinfo/home_terminfo.c b/lib/libcurses/tinfo/home_terminfo.c index 9ed5c5f0e32..f225d33654b 100644 --- a/lib/libcurses/tinfo/home_terminfo.c +++ b/lib/libcurses/tinfo/home_terminfo.c @@ -1,7 +1,7 @@ -/* $OpenBSD: home_terminfo.c,v 1.4 2000/10/02 17:33:47 millert Exp $ */ +/* $OpenBSD: home_terminfo.c,v 1.5 2000/10/08 22:47:01 millert Exp $ */ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 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 * @@ -29,7 +29,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey <dickey@clark.net> 1998 * + * Author: Thomas E. Dickey <dickey@clark.net> 1998,2000 * ****************************************************************************/ /* @@ -39,7 +39,7 @@ #include <curses.priv.h> #include <tic.h> -MODULE_ID("$From: home_terminfo.c,v 1.2 1999/02/27 19:58:46 tom Exp $") +MODULE_ID("$From: home_terminfo.c,v 1.3 2000/10/04 02:31:53 tom Exp $"); #define my_length (strlen(home) + sizeof(PRIVATE_INFO)) @@ -48,17 +48,20 @@ MODULE_ID("$From: home_terminfo.c,v 1.2 1999/02/27 19:58:46 tom Exp $") char * _nc_home_terminfo(void) { - char *home; - static char *temp = 0; + char *home; + static char *temp = 0; - if (temp == 0 && !issetugid()) { - if ((home = getenv("HOME")) != 0 && *home != '\0' - && my_length <= PATH_MAX) { - temp = typeMalloc(char, my_length); - if (temp == 0) - _nc_err_abort("Out of memory"); - (void) sprintf(temp, PRIVATE_INFO, home); - } + if (use_terminfo_vars()) { + if (temp == 0) { + if ((home = getenv("HOME")) != 0 + && my_length <= PATH_MAX) { + temp = typeMalloc(char, my_length); + if (temp == 0) + _nc_err_abort("Out of memory"); + (void) sprintf(temp, PRIVATE_INFO, home); + } } return temp; + } + return 0; } |