- char *home;
- static char *temp = 0;
-
- 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);
- }
+ char *result = 0;
+#if USE_HOME_TERMINFO
+ char *home;
+
+ if (use_terminfo_vars()) {
+ if (MyBuffer == 0) {
+ if ((home = getenv("HOME")) != 0) {
+ unsigned want = (strlen(home) + sizeof(PRIVATE_INFO));
+ MyBuffer = typeMalloc(char, want);
+ if (MyBuffer == 0)
+ _nc_err_abort(MSG_NO_MEMORY);
+ (void) sprintf(MyBuffer, PRIVATE_INFO, home);
+ }