X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fhome_terminfo.c;h=7e626dfcaad714f8b492719c5fae264f902d3051;hp=e77f71c2aeb1e21edc804cff774ce75d55ec4088;hb=a28e782d7794ddeec23e7cb212dc455f0d93dc22;hpb=91fa4688e82518794fcf0c32a36f3fcca5e4c2d5 diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c index e77f71c2..7e626dfc 100644 --- a/ncurses/tinfo/home_terminfo.c +++ b/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2012,2016 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 * @@ -37,7 +38,7 @@ #include #include -MODULE_ID("$Id: home_terminfo.c,v 1.15 2012/10/27 21:49:14 tom Exp $") +MODULE_ID("$Id: home_terminfo.c,v 1.17 2020/02/02 23:34:34 tom Exp $") /* ncurses extension...fall back on user's private directory */ @@ -48,10 +49,11 @@ _nc_home_terminfo(void) { char *result = 0; #if USE_HOME_TERMINFO - char *home; - if (use_terminfo_vars()) { + if (MyBuffer == 0) { + char *home; + if ((home = getenv("HOME")) != 0) { size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); TYPE_MALLOC(char, want, MyBuffer);