Commit 270f09cb 270f09cb8a746d05285b245ce1a33d32fd230136 by Sergey Poznyakoff

(read_rc, mu_create_argcv): Do not bail out if mu_tilde_expansion() returns NUL…

…L. There may be users without homedir.
1 parent ff448ff8
......@@ -572,10 +572,7 @@ read_rc (const char *progname, const char *name, const char *capa[],
char* rcfile = mu_tilde_expansion (name, "/", NULL);
if (!rcfile)
{
fprintf (stderr, _("%s: not enough memory\n"), progname);
exit (1);
}
return;
fp = fopen (rcfile, "r");
if (!fp)
......@@ -717,19 +714,15 @@ mu_create_argcv (const char *capa[],
struct stat s;
char* rcdirname = mu_tilde_expansion (MU_USER_CONFIG_FILE, "/", NULL);
if (!rcdirname)
{
fprintf (stderr, _("%s: not enough memory\n"), progname);
exit (1);
}
if(stat(rcdirname, &s) == 0 && S_ISDIR(s.st_mode))
if (!rcdirname
|| (stat(rcdirname, &s) == 0 && S_ISDIR(s.st_mode)))
rcdir = 1;
free(rcdirname);
}
/* Add per-user config file. */
if(!rcdir)
if (!rcdir)
{
read_rc (progname, MU_USER_CONFIG_FILE, capa, &x_argc, &x_argv);
}
......