46e6f2
diff -up which-2.19/bash.c.afs which-2.19/bash.c
46e6f2
--- which-2.19/bash.c.afs	2008-01-18 19:03:40.000000000 +0100
46e6f2
+++ which-2.19/bash.c	2008-01-25 11:41:14.000000000 +0100
46e6f2
@@ -34,7 +34,6 @@
46e6f2
  */
46e6f2
 #define HAVE_GETGROUPS
46e6f2
 #undef SHELL
46e6f2
-#undef AFS
46e6f2
 #undef NOGROUP
46e6f2
 
46e6f2
 /*
46e6f2
@@ -251,7 +250,7 @@ file_status (char const* name)
46e6f2
 
46e6f2
   r = FS_EXISTS;
46e6f2
 
46e6f2
-#if defined (AFS)
46e6f2
+  if (getenv("AFS")) {
46e6f2
   /* We have to use access(2) to determine access because AFS does not
46e6f2
      support Unix file system semantics.  This may produce wrong
46e6f2
      answers for non-AFS files when ruid != euid.  I hate AFS. */
46e6f2
@@ -261,8 +260,9 @@ file_status (char const* name)
46e6f2
     r |= FS_READABLE;
46e6f2
 
46e6f2
   return r;
46e6f2
-#else /* !AFS */
46e6f2
-
46e6f2
+  }
46e6f2
+  else /* !AFS */
46e6f2
+  {
46e6f2
   /* Find out if the file is actually executable.  By definition, the
46e6f2
      only other criteria is that the file has an execute bit set that
46e6f2
      we can use.  The same with whether or not a file is readable. */
46e6f2
@@ -305,7 +305,7 @@ file_status (char const* name)
46e6f2
     }
46e6f2
 
46e6f2
   return r;
46e6f2
-#endif /* !AFS */
46e6f2
+  } /* !AFS */
46e6f2
 }
46e6f2
 
46e6f2
 /* From bash-3.2 / general.c / line 534 ; Changes: Using 'strchr' instead of 'xstrchr'. */