summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 720a94391..1cc5cf394 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -104,13 +104,13 @@ find_exec (const char *name, path_conv& buf, const char *search,
if ((has_slash || opt & FE_CWD)
&& (suffix = perhaps_suffix (name, buf, err, opt)) != NULL)
{
+ /* Overwrite potential symlink target with original path.
+ See comment preceeding this method. */
+ tmp_path = tmp;
if (!has_slash)
- {
- /* Overwrite potential symlink target with original path.
- See comment preceeding this method. */
- stpcpy (stpcpy (tmp, "./"), name);
- buf.set_posix (tmp);
- }
+ tmp_path = stpcpy (tmp, "./");
+ stpcpy (tmp_path, name);
+ buf.set_posix (tmp);
retval = buf.get_posix ();
goto out;
}