This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: which 1.6-1


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]