Blame SOURCES/which-2.19-afs.patch

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