diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e74ee16fbd7..3734528f6b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-02-04 Neil Booth + + * cccp.c (main): Check 'dir' for a NULL pointer before passing + it to strcmp. + 2000-02-04 Zack Weinberg * recog.h: Remove NO_MD_PROTOTYPES ifdefs. diff --git a/gcc/cccp.c b/gcc/cccp.c index 8771d0d3844..7f2f58483c0 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -1715,7 +1715,7 @@ main (argc, argv) struct file_name_list *dirtmp; char *dir = argv[i][2] ? argv[i] + 2 : argv[++i]; - if (! ignore_srcdir && !strcmp (dir, "-")) { + if (! ignore_srcdir && dir && !strcmp (dir, "-")) { ignore_srcdir = 1; /* Don't use any preceding -I directories for #include <...>. */ first_bracket_include = 0;