about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/execvp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/posix/execvp.c b/posix/execvp.c
index 5b1e14bf1a..7afb01d11f 100644
--- a/posix/execvp.c
+++ b/posix/execvp.c
@@ -54,7 +54,7 @@ execute (const char *file, char *const argv[])
 	/* Execute the shell.  */
 	execv (new_argv[0], new_argv);
       }
-	}
+    }
 }
 
 
@@ -67,6 +67,13 @@ execvp (file, argv)
 {
   int got_eacces = 0;
 
+  if (*file == '\0')
+    {
+      /* We check the simple case first. */
+      __set_errno (ENOENT);
+      return -1;
+    }
+
   if (strchr (file, '/') != NULL)
     /* Don't search when it contains a slash.  */
     execute (file, argv);