Browse Source

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>
maint
Thomas Schwinge 18 years ago committed by Junio C Hamano
parent
commit
8b4aee015e
  1. 2
      builtin-add.c

2
builtin-add.c

@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,
path = git_path("info/exclude"); path = git_path("info/exclude");
if (!access(path, R_OK)) if (!access(path, R_OK))
add_excludes_from_file(dir, path); 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); add_excludes_from_file(dir, excludes_file);
} }



Loading…
Cancel
Save