summaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2007-07-28 20:26:35 +0200
committerJunio C Hamano <gitster@pobox.com>2007-07-28 18:50:36 -0700
commit8b4aee015e2d81dc6cc53328aedc66742a5306d8 (patch)
treece7f5168143359b93158476e83b61f8fbae7c052 /builtin-add.c
parent12075103ddc9a061cf6f3b04feb206123bb78e2f (diff)
downloadgit-8b4aee015e2d81dc6cc53328aedc66742a5306d8.tar.gz
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>
Diffstat (limited to 'builtin-add.c')
-rw-r--r--builtin-add.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-add.c b/builtin-add.c
index 734547994f..de5c108f8f 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,
path = git_path("info/exclude");
if (!access(path, R_OK))
add_excludes_from_file(dir, path);
- if (!access(excludes_file, R_OK))
+ if (excludes_file != NULL && !access(excludes_file, R_OK))
add_excludes_from_file(dir, excludes_file);
}