diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-06-27 19:13:06 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-06-27 19:13:06 +0000 |
commit | fb3e9d63a5bd167f2387174ca7ad8c8f9d9d8468 (patch) | |
tree | 31e32dbcafad7250971e3cf6662c1e7b4b454f11 /test | |
parent | 63342ff906c121b36440ae7a41449e87f5b5f689 (diff) |
add test case for argv[0] == null
Diffstat (limited to 'test')
-rw-r--r-- | test/unistd/exec-null.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unistd/exec-null.c b/test/unistd/exec-null.c new file mode 100644 index 000000000..3df99f3ce --- /dev/null +++ b/test/unistd/exec-null.c @@ -0,0 +1,13 @@ +/* make sure we handle argv[0] == NULL */ + +#include <unistd.h> + +int main(int argc, char *argv[]) +{ + if (argc == 0) + return 0; + + char *exec_argv[1], *exec_envp[1]; + exec_argv[0] = exec_envp[0] = NULL; + return execve("./exec-null", exec_argv, exec_envp); +} |