diff -urN nano-1.2.1-orig/rcfile.c nano-1.2.1/rcfile.c --- nano-1.2.1-orig/rcfile.c 2003-03-11 05:50:40.000000000 +0200 +++ nano-1.2.1/rcfile.c 2003-08-14 10:39:56.000000000 +0300 @@ -32,6 +32,7 @@ #include #include #include +#include #include "proto.h" #include "nano.h" @@ -181,6 +182,29 @@ return ptr; } +/* Read additional config files */ +void parse_insert(char *ptr) +{ + FILE *rc; + char *pattern = ptr; + glob_t g; + int i = 0; + + ptr = parse_next_word(ptr); + + glob(pattern, GLOB_TILDE, NULL, &g); + while (g.gl_pathv[i]) { + if ((rc = fopen(g.gl_pathv[i++], "r")) == NULL) { + rcfile_error(_("Unable to read file, %s"), + strerror(errno)); + } else { + parse_rcfile(rc); + fclose(rc); + } + } + globfree(&g); +} + #ifdef ENABLE_COLOR int colortoint(const char *colorname, int *bright) @@ -499,6 +523,8 @@ set = 1; else if (!strcasecmp(keyword, "unset")) set = -1; + else if (!strcasecmp(keyword, "insert")) + parse_insert(ptr); #ifdef ENABLE_COLOR else if (!strcasecmp(keyword, "syntax")) parse_syntax(ptr);