rcfile.c:do_rcfile() - Parse rcfile in as well (Dwayne Rightler)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1077 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
bc72e366d2
commit
ff8a68c258
|
@ -26,6 +26,8 @@ CVS code -
|
||||||
parse_next_regex()
|
parse_next_regex()
|
||||||
- Allow " symbol to be in regex without leading \ by checking
|
- Allow " symbol to be in regex without leading \ by checking
|
||||||
for *ptr+1 is not the end of the regex.
|
for *ptr+1 is not the end of the regex.
|
||||||
|
do_rcfile()
|
||||||
|
- Parse rcfile in $SYSCONFDIR as well (Dwayne Rightler).
|
||||||
- nano.c:
|
- nano.c:
|
||||||
help_init()
|
help_init()
|
||||||
- Added message re: having multiple blank buffers (DLR).
|
- Added message re: having multiple blank buffers (DLR).
|
||||||
|
|
14
rcfile.c
14
rcfile.c
|
@ -432,12 +432,24 @@ void do_rcfile(void)
|
||||||
{
|
{
|
||||||
char *unable = _("Unable to open ~/.nanorc file, %s");
|
char *unable = _("Unable to open ~/.nanorc file, %s");
|
||||||
struct stat fileinfo;
|
struct stat fileinfo;
|
||||||
|
int skip=0;
|
||||||
FILE *rcstream;
|
FILE *rcstream;
|
||||||
|
|
||||||
|
|
||||||
if (getenv("HOME") == NULL)
|
if (getenv("HOME") == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
nanorc = charalloc(strlen(SYSCONFDIR) + 10);
|
||||||
|
sprintf(nanorc, "%s/nanorc", SYSCONFDIR);
|
||||||
|
|
||||||
|
/* Try to open system nanorc */
|
||||||
|
if (stat(nanorc, &fileinfo) != -1)
|
||||||
|
if ((rcstream = fopen(nanorc, "r")) != NULL) {
|
||||||
|
|
||||||
|
/* Parse it! */
|
||||||
|
parse_rcfile(rcstream);
|
||||||
|
fclose(rcstream);
|
||||||
|
}
|
||||||
|
|
||||||
nanorc = charalloc(strlen(getenv("HOME")) + 10);
|
nanorc = charalloc(strlen(getenv("HOME")) + 10);
|
||||||
sprintf(nanorc, "%s/.nanorc", getenv("HOME"));
|
sprintf(nanorc, "%s/.nanorc", getenv("HOME"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue