This is the mail archive of the
cygwin
mailing list for the Cygwin project.
[PATCH]: which 1.6-1
- From: Daniel Bell <dbell at zikzak dot net>
- To: cygwin at cygwin dot com
- Date: Thu, 28 Apr 2005 22:10:30 +1000
- Subject: [PATCH]: which 1.6-1
- Reply-to: daniel dot m dot bell at gmail dot com
Hi,
I have used "which" under cygwin and discovered that it does not work
correctly (compared to solaris which) when passed an absolute path. For
example:
which /usr/bin/ksh
returns "command not found" under cygwin but "/usr/bin/ksh" under
solaris. I have created a patch against which 1.6-1 that checks for an
absolute path.
Daniel.
--- which.c.orig 2004-12-27 09:26:16.001000000 +1100
+++ which.c 2005-04-28 21:55:06.136577600 +1000
@@ -97,6 +97,11 @@
char cmdpath[PATH_MAX];
int found = 0;
+ if ((cmd[0] == '/') && (check(cmd)))
+ {
+ puts(cmd);
+ continue;
+ }
for (i = 0; i < pcnt; ++i)
{
strcpy (cmdpath, path[i]);
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/