From: Thomas Schwinge Date: Sat, 28 Jul 2007 18:26:35 +0000 (+0200) Subject: Don't rely on unspecified behavior X-Git-Tag: v1.5.3-rc4~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b4aee015e2d81dc6cc53328aedc66742a5306d8;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-add.c b/builtin-add.c index 734547994..de5c108f8 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); }