Don't rely on unspecified behavior
Calling access(p, m) with p == NULL is not specified, so don't do that. On GNU/Hurd systems doing so will result in a SIGSEGV. Signed-off-by: Thomas Schwinge <tschwinge@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Schwinge committed
Jul 28, 2007 at 20:26 UTC
8b4aee015e2d81dc6cc53328aedc66742a5306d8
1 file changed
+1
-1
builtin-add.c
+1
-1
@@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,
60
path = git_path("info/exclude");
61
if (!access(path, R_OK))
62
add_excludes_from_file(dir, path);
63
- if (!access(excludes_file, R_OK))
63
+ if (excludes_file != NULL && !access(excludes_file, R_OK))
64
add_excludes_from_file(dir, excludes_file);
65
}
66