Print the full PATH in the log if gpg was not found.
* src/posix-util.c (walk_path): Keep a copy of PATH.
This commit is contained in:
parent
6564e5e78e
commit
d63058b852
@ -75,17 +75,18 @@ _gpgme_set_default_gpgconf_name (const char *name)
|
|||||||
static char *
|
static char *
|
||||||
walk_path (const char *pgm)
|
walk_path (const char *pgm)
|
||||||
{
|
{
|
||||||
const char *path, *s;
|
const char *orig_path, *path, *s;
|
||||||
char *fname, *p;
|
char *fname, *p;
|
||||||
|
|
||||||
path = getenv ("PATH");
|
orig_path = getenv ("PATH");
|
||||||
if (!path)
|
if (!orig_path)
|
||||||
path = "/bin:/usr/bin:.";
|
orig_path = "/bin:/usr/bin:.";
|
||||||
|
|
||||||
fname = malloc (strlen (path) + 1 + strlen (pgm) + 1);
|
fname = malloc (strlen (orig_path) + 1 + strlen (pgm) + 1);
|
||||||
if (!fname)
|
if (!fname)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
path = orig_path;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
for (s=path, p=fname; *s && *s != ':'; s++, p++)
|
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'",
|
_gpgme_debug (DEBUG_ENGINE, "gpgme-walk_path: '%s' not found in '%s'",
|
||||||
pgm, path);
|
pgm, orig_path);
|
||||||
|
|
||||||
free (fname);
|
free (fname);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user