538 |
|
|
539 |
fp = fopen (rcfile, "r"); |
fp = fopen (rcfile, "r"); |
540 |
if (!fp) |
if (!fp) |
541 |
{ |
{ |
542 |
free(rcfile); |
free(rcfile); |
543 |
return; |
return; |
544 |
} |
} |
545 |
|
|
546 |
while (getline (&buf, &n, fp) > 0) |
while (getline (&buf, &n, fp) > 0) |
547 |
{ |
{ |
589 |
|
|
590 |
len = 0; |
len = 0; |
591 |
if(progname) |
if(progname) |
592 |
{ |
{ |
593 |
for (p = kwp; *p && !isspace (*p); p++) |
for (p = kwp; *p && !isspace (*p); p++) |
594 |
len++; |
len++; |
595 |
} |
} |
596 |
else |
else |
597 |
p = kwp; /* Use the whole line. */ |
p = kwp; /* Use the whole line. */ |
598 |
|
|
624 |
x_argv[x_argc++] = n_argv[i]; |
x_argv[x_argc++] = n_argv[i]; |
625 |
|
|
626 |
free (n_argv); |
free (n_argv); |
|
if (linebuf) |
|
|
free (linebuf); |
|
|
linebuf = NULL; |
|
627 |
} |
} |
628 |
|
if (linebuf) |
629 |
|
free (linebuf); |
630 |
|
linebuf = NULL; |
631 |
} |
} |
632 |
fclose (fp); |
fclose (fp); |
633 |
free(rcfile); |
free(rcfile); |
689 |
|
|
690 |
/* Add per-user config file. */ |
/* Add per-user config file. */ |
691 |
if(!rcdir) |
if(!rcdir) |
692 |
{ |
{ |
693 |
read_rc (progname, MU_USER_CONFIG_FILE, capa, &x_argc, &x_argv); |
read_rc (progname, MU_USER_CONFIG_FILE, capa, &x_argc, &x_argv); |
694 |
} |
} |
695 |
else |
else |
696 |
{ |
{ |
697 |
char* userrc = NULL; |
char* userrc = NULL; |
|
|
|
|
mu_asprintf(&userrc, "%s/mailutils", MU_USER_CONFIG_FILE); |
|
698 |
|
|
699 |
if (!userrc) |
mu_asprintf(&userrc, "%s/mailutils", MU_USER_CONFIG_FILE); |
|
{ |
|
|
fprintf (stderr, "%s: not enough memory\n", progname); |
|
|
exit (1); |
|
|
} |
|
|
read_rc (progname, userrc, capa, &x_argc, &x_argv); |
|
700 |
|
|
701 |
free(userrc); |
if (!userrc) |
702 |
} |
{ |
703 |
|
fprintf (stderr, "%s: not enough memory\n", progname); |
704 |
|
exit (1); |
705 |
|
} |
706 |
|
read_rc (progname, userrc, capa, &x_argc, &x_argv); |
707 |
|
|
708 |
|
free(userrc); |
709 |
|
} |
710 |
|
|
711 |
/* Add per-user, per-program config file. */ |
/* Add per-user, per-program config file. */ |
712 |
{ |
{ |
713 |
char* progrc = NULL; |
char* progrc = NULL; |
714 |
|
|
715 |
if(rcdir) |
if(rcdir) |
716 |
mu_asprintf(&progrc, "%s/%src", MU_USER_CONFIG_FILE, progname); |
mu_asprintf(&progrc, "%s/%src", MU_USER_CONFIG_FILE, progname); |
717 |
else |
else |