+2015-03-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * spawn.cc (find_exec): Fix a name change in case of a symlink which
+ can be opened as is.
+
2015-03-12 Jon TURNEY <jon.turney@dronecode.org.uk>
* exceptions.cc (stack_info): Add sigstackptr member.
- Fix potential premature SIGHUP in pty code.
Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00070.html
+
+- Fix a name change from symlink to target name in calls to execvp, system, etc.
+ Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00270.html
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;
}