cccp.c (main): Check 'dir' for a NULL pointer before passing it to strcmp.

2000-02-04  Neil Booth  <NeilB@earthling.net>

	* cccp.c (main): Check 'dir' for a NULL pointer before passing
	it to strcmp.

From-SVN: r31802
This commit is contained in:
Neil Booth 2000-02-05 05:04:09 +00:00 committed by Zack Weinberg
parent 706b0f603f
commit f15e0a178d
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2000-02-04 Neil Booth <NeilB@earthling.net>
* cccp.c (main): Check 'dir' for a NULL pointer before passing
it to strcmp.
2000-02-04 Zack Weinberg <zack@wolery.cumb.org>
* recog.h: Remove NO_MD_PROTOTYPES ifdefs.

View File

@ -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;