aboutsummaryrefslogtreecommitdiffstats
path: root/src/posix-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/posix-util.c')
-rw-r--r--src/posix-util.c13
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;