From: Thomas Schwinge Date: Sat, 28 Jul 2007 16:39:39 GMT Subject: [PATCH] Don't rely on unspecified behavior Message-ID: <11856407791617-git-send-email-tschwinge@gnu.org> In-Reply-To: <11856407793933-git-send-email-tschwinge@gnu.org> Calling access(p, m) with p == NULL is not specified, so don't do that. On GNU/Hurd systems doing so will result in an SIGSEGV. Signed-off-by: Thomas Schwinge --- builtin-add.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/builtin-add.c b/builtin-add.c index 5e6748f..c13c738 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -74,7 +74,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); /* -- 1.5.3.rc3.26.g6c58-dirty