diff src/dumper.c @ 1466:88a2f43560bf

[xemacs-hg @ 2003-05-09 01:41:56 by youngs] 2003-05-09 Martin Buchholz <martin@xemacs.org> * dumper.c (pdump_load): Pdump'ed XEmacs can't find its .dmp file. Scenario: Prepend ~/bin to PATH; then `mkdir ~/bin/xemacs' Result: "temacs can only be run in -batch mode." Fix: Check xemacs executable candidate for directory-ness.
author youngs
date Fri, 09 May 2003 01:41:56 +0000
parents 1b0339b048ce
children a72f7bf813c9
line wrap: on
line diff
--- a/src/dumper.c	Thu May 08 21:52:32 2003 +0000
+++ b/src/dumper.c	Fri May 09 01:41:56 2003 +0000
@@ -1595,8 +1595,17 @@
 	    }
 	  strcpy (w, name);
 
-	  if (!access (exe_path, X_OK))
-	    break;
+#undef access /* avoid !@#$%^& encapsulated access */
+#undef stat   /* avoid !@#$%^& encapsulated stat */
+
+	  {
+	    struct stat statbuf;
+	    if (access (exe_path, X_OK) == 0
+		&& stat (exe_path, &statbuf) == 0
+		&& ! S_ISDIR (statbuf.st_mode))
+	      break;
+	  }
+
 	  if (!*p)
 	    {
 	      /* Oh well, let's have some kind of default */