This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [Patch] "strace ./app.exe" probably runs application from /bin
cygcheck is also affected by the same issue like strace:
$ cd /tmp
$ cygcheck ./ls
C:\cygwin\bin\ls.exe
...
$ cygcheck ././ls
ls - cannot open.
The attached patch fixes this for strace and cygcheck.
It does not fix the cygcheck issue reported by Brian.
All other calls to path.cc:cygpath() use absolute path names.
So it should not break anything to keep a leading "./".
2007-06-03 Christian Franke <franke@computer.org>
* path.cc (cygpath): Don't remove leading "./" to avoid
invalid application search in strace and cygcheck.
Christian
--- cygwin-1.5.24-2.orig/winsup/utils/path.cc 2005-04-29 18:39:34.001000000 +0200
+++ cygwin-1.5.24-2/winsup/utils/path.cc 2007-06-03 15:40:56.093750000 +0200
@@ -278,8 +278,6 @@ cygpath (const char *s, ...)
read_mounts ();
va_start (v, s);
char *path = vconcat (s, v);
- if (strncmp (path, "./", 2) == 0)
- memmove (path, path + 2, strlen (path + 2) + 1);
if (strncmp (path, "/./", 3) == 0)
memmove (path + 1, path + 3, strlen (path + 3) + 1);