Changeset
37209157e33c converted filters to use the envlist.
Unfortunately, I missed that pgp.c sets GPG_TTY when using the GnuPG
agent. Convert to add GPG_TTY to the envlist too.
if (MuttIndexWindow && (MuttIndexWindow->cols > 0))
{
snprintf (columns, sizeof (columns), "%d", MuttIndexWindow->cols);
- mutt_envlist_set ("COLUMNS", columns);
+ mutt_envlist_set ("COLUMNS", columns, 1);
}
execle (EXECSHELL, "sh", "-c", cmd, NULL, mutt_envlist ());
* It's broken out because some other parts of mutt (filter.c) need
* to set/overwrite environment variables in envlist before execing.
*/
-void mutt_envlist_set (const char *name, const char *value)
+void mutt_envlist_set (const char *name, const char *value, int overwrite)
{
char **envp = envlist;
char work[LONG_STRING];
while (envp && *envp)
{
if (!mutt_strncmp (name, *envp, len) && (*envp)[len] == '=')
+ {
+ if (!overwrite)
+ return;
break;
+ }
envp++;
count++;
}
name = safe_strdup (tmp->data);
mutt_extract_token (tmp, s, 0);
- mutt_envlist_set (name, tmp->data);
+ mutt_envlist_set (name, tmp->data, 1);
FREE (&name);
return 0;
return 0;
if ((tty = ttyname(0)))
+ {
setenv("GPG_TTY", tty, 0);
+ mutt_envlist_set ("GPG_TTY", tty, 0);
+ }
return 1;
}
void mutt_edit_file (const char *, const char *);
void mutt_edit_headers (const char *, const char *, HEADER *, char *, size_t);
char **mutt_envlist (void);
-void mutt_envlist_set (const char *name, const char *value);
+void mutt_envlist_set (const char *name, const char *value, int overwrite);
int mutt_filter_unprintable (char **);
int mutt_label_message (HEADER *);
void mutt_make_label_hash (CONTEXT *);