diff options
author | Werner Koch <wk@gnupg.org> | 2011-02-04 12:57:53 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-02-04 12:57:53 +0100 |
commit | b008274afdbe375b32a7e66dbd073e200f6f0587 (patch) | |
tree | 219e239d39cf06be3f03aa82fb572080ac163a15 /common/session-env.c | |
parent | Let autogen.sh check the git config (diff) | |
download | gnupg2-b008274afdbe375b32a7e66dbd073e200f6f0587.tar.xz gnupg2-b008274afdbe375b32a7e66dbd073e200f6f0587.zip |
Nuked almost all trailing white space.post-nuke-of-trailing-ws
We better do this once and for all instead of cluttering all future
commits with diffs of trailing white spaces. In the majority of cases
blank or single lines are affected and thus this change won't disturb
a git blame too much. For future commits the pre-commit scripts
checks that this won't happen again.
Diffstat (limited to 'common/session-env.c')
-rw-r--r-- | common/session-env.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/common/session-env.c b/common/session-env.c index d719a7b87..7f4ca5eea 100644 --- a/common/session-env.c +++ b/common/session-env.c @@ -49,8 +49,8 @@ struct session_environment_s /* A list of environment vribales we pass from the acual user (e.g. gpgme) down to the pinentry. We do not handle the locale settings because they do not only depend on envvars. */ -static struct -{ +static struct +{ const char *name; const char *assname; /* Name used by Assuan or NULL. */ } stdenvnames[] = { @@ -64,7 +64,7 @@ static struct modules (eg "scim-bridge"). */ { "QT_IM_MODULE" }, /* Used by Qt to select qt input modules (eg "xim"). */ - { "PINENTRY_USER_DATA", "pinentry-user-data"} + { "PINENTRY_USER_DATA", "pinentry-user-data"} /* Used for communication with non-standard Pinentries. */ }; @@ -109,7 +109,7 @@ session_env_new (void) se = xtrycalloc (1, sizeof *se); if (se) { - se->arraysize = (lastallocatedarraysize? + se->arraysize = (lastallocatedarraysize? lastallocatedarraysize : INITIAL_ARRAYSIZE); se->array = xtrycalloc (se->arraysize, sizeof *se->array); if (!se->array) @@ -132,7 +132,7 @@ session_env_release (session_env_t se) if (!se) return; - if (se->arraysize > INITIAL_ARRAYSIZE + if (se->arraysize > INITIAL_ARRAYSIZE && se->arraysize <= MAXDEFAULT_ARRAYSIZE && se->arraysize > lastallocatedarraysize) lastallocatedarraysize = se->arraysize; @@ -249,7 +249,7 @@ gpg_error_t session_env_putenv (session_env_t se, const char *string) { const char *s; - + if (!string || !*string) return gpg_error (GPG_ERR_INV_VALUE); s = strchr (string, '='); @@ -325,7 +325,7 @@ session_env_getenv_or_default (session_env_t se, const char *name, *r_default = 1; return se->array[idx]->value; } - + /* Get the default value with an additional fallback for GPG_TTY. */ defvalue = getenv (name); if ((!defvalue || !*defvalue) && !strcmp (name, "GPG_TTY") && ttyname (0)) @@ -339,7 +339,7 @@ session_env_getenv_or_default (session_env_t se, const char *name, explicit error anyway and the following scan would then fail anyway. */ update_var (se, name, strlen (name), defvalue, 1); - + for (idx=0; idx < se->arrayused; idx++) if (se->array[idx] && !strcmp (se->array[idx]->name, name)) { @@ -359,7 +359,7 @@ session_env_getenv_or_default (session_env_t se, const char *name, R_DEFAULT is not NULL, the default flag is stored on return. The default flag indicates that the value has been taken from the process' environment. The caller must not change the returned - name or value. */ + name or value. */ char * session_env_listenv (session_env_t se, int *iterator, const char **r_value, int *r_default) @@ -381,5 +381,3 @@ session_env_listenv (session_env_t se, int *iterator, } return NULL; } - - |