diff options
| author | Werner Koch <[email protected]> | 2014-01-07 11:44:55 +0000 | 
|---|---|---|
| committer | Werner Koch <[email protected]> | 2014-01-07 11:44:55 +0000 | 
| commit | d63058b852b83515e7715103c04a684ecf59838a (patch) | |
| tree | 823bb710a2af81def207c418cf3603185a046ef4 /src/posix-util.c | |
| parent | Add global flags disable-gpgconf, gpgconf-name, and gpg-name. (diff) | |
| download | gpgme-d63058b852b83515e7715103c04a684ecf59838a.tar.gz gpgme-d63058b852b83515e7715103c04a684ecf59838a.zip | |
Print the full PATH in the log if gpg was not found.
* src/posix-util.c (walk_path): Keep a copy of PATH.
Diffstat (limited to 'src/posix-util.c')
| -rw-r--r-- | src/posix-util.c | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/src/posix-util.c b/src/posix-util.c index 5bfc4865..1b92ec17 100644 --- a/src/posix-util.c +++ b/src/posix-util.c @@ -75,17 +75,18 @@ _gpgme_set_default_gpgconf_name (const char *name)  static char *  walk_path (const char *pgm)  { -  const char *path, *s; +  const char *orig_path, *path, *s;    char *fname, *p; -  path = getenv ("PATH"); -  if (!path) -    path = "/bin:/usr/bin:."; +  orig_path = getenv ("PATH"); +  if (!orig_path) +    orig_path = "/bin:/usr/bin:."; -  fname = malloc (strlen (path) + 1 + strlen (pgm) + 1); +  fname = malloc (strlen (orig_path) + 1 + strlen (pgm) + 1);    if (!fname)      return NULL; +  path = orig_path;    for (;;)      {        for (s=path, p=fname; *s && *s != ':'; s++, p++) @@ -101,7 +102,7 @@ walk_path (const char *pgm)      }    _gpgme_debug (DEBUG_ENGINE, "gpgme-walk_path: '%s' not found in '%s'", -                pgm, path); +                pgm, orig_path);    free (fname);    return NULL; | 
