version 1.106, 2019/06/22 10:21:57 |
version 1.107, 2021/02/23 08:10:51 |
|
|
* to the startup file name. |
* to the startup file name. |
*/ |
*/ |
char * |
char * |
startupfile(char *suffix) |
startupfile(char *suffix, char *conffile) |
{ |
{ |
static char file[NFILEN]; |
static char file[NFILEN]; |
char *home; |
char *home; |
|
|
if ((home = getenv("HOME")) == NULL || *home == '\0') |
if ((home = getenv("HOME")) == NULL || *home == '\0') |
goto nohome; |
goto nohome; |
|
|
if (suffix == NULL) { |
if (conffile != NULL) { |
|
(void)strncpy(file, conffile, NFILEN); |
|
} else if (suffix == NULL) { |
ret = snprintf(file, sizeof(file), _PATH_MG_STARTUP, home); |
ret = snprintf(file, sizeof(file), _PATH_MG_STARTUP, home); |
if (ret < 0 || ret >= sizeof(file)) |
if (ret < 0 || ret >= sizeof(file)) |
return (NULL); |
return (NULL); |