[PATCH]: which 1.6-1

Daniel Bell dbell@zikzak.net
Thu Apr 28 13:30:00 GMT 2005


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/



More information about the Cygwin mailing list