X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=1f5d36570e6f9a3fbc86812db62126a497ba2d0d;hp=3e34dc8a7f5b371e1709e9469af546f2df585dd1;hb=618ceafdc9564dbb8f3bf45c3869297a1d5a3320;hpb=364bf52ada05bf7d7158dba9d2391f63b71258f6 diff --git a/init.c b/init.c index 3e34dc8..1f5d365 100644 --- a/init.c +++ b/init.c @@ -58,11 +58,11 @@ typedef struct { } syn_t; /* for synonym warning reports: list of synonyms found */ -list2_t* Synonyms; +static list2_t* Synonyms; /* for synonym warning reports: current rc file */ -char* CurRCFile = NULL; +static const char* CurRCFile = NULL; /* for synonym warning reports: current rc line */ -int CurRCLine = 0; +static int CurRCLine = 0; /* prototypes for checking for special vars */ static int check_dsn_return (const char*); @@ -1461,8 +1461,6 @@ static int source_rc (const char *rcfile, BUFFER * err) pid_t pid; debug_print (2, ("reading configuration file '%s'.\n", rcfile)); - str_replace (&CurRCFile, rcfile); - CurRCLine = 0; if ((f = mutt_open_read (rcfile, &pid)) == NULL) { snprintf (err->data, err->dsize, "%s: %s", rcfile, strerror (errno)); @@ -1471,7 +1469,6 @@ static int source_rc (const char *rcfile, BUFFER * err) memset (&token, 0, sizeof (token)); while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL) { - CurRCLine++; conv = ConfigCharset && (*ConfigCharset) && Charset; if (conv) { currentline = str_dup (linebuf); @@ -1482,6 +1479,9 @@ static int source_rc (const char *rcfile, BUFFER * err) else currentline = linebuf; + CurRCLine = line; + CurRCFile = rcfile; + if (mutt_parse_rc_line (currentline, &token, err) == -1) { mutt_error (_("Error in %s, line %d: %s"), rcfile, line, err->data); if (--rc < -MAXERRS) { @@ -2228,12 +2228,10 @@ void mutt_init (int skip_sys_rc, LIST * commands) MuttVars[((syn_t*) Synonyms->data[i])->n].option, NONULL(((syn_t*) Synonyms->data[i])->f), ((syn_t*) Synonyms->data[i])->l); - fprintf (stderr, _("Warning: Synonym variables are scheduled for removal.\n")); + fprintf (stderr, _("Warning: synonym variables are scheduled for removal.\n")); list_del (&Synonyms, syn_del); need_pause = 1; } - /* this is not needed during runtime */ - mem_free(&CurRCFile); if (need_pause && !option (OPTNOCURSES)) { if (mutt_any_key_to_continue (NULL) == -1) @@ -2289,7 +2287,7 @@ int mutt_dump_variables (void) { snprintf (command, sizeof (command), "set ?%s\n", ((struct option_t*) tmp->data[i])->option); if (mutt_parse_rc_line (command, &token, &err) == -1) { - fprintf (stderr, "%s\n", err.data); + printf ("%s\n", err.data); mem_free (&token.data); list_del (&tmp, NULL); return 1;