From 37114d0dbc247dd1cf79dd74d9813bf8ea0a84c4 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sun, 16 Feb 1992 08:08:39 +0000 Subject: *** empty log message *** From-SVN: r331 --- gcc/protoize.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/protoize.c b/gcc/protoize.c index 2b7dd81..ed72c58 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -955,7 +955,18 @@ directory_specified_p (name) for (p = directory_list; p; p = p->next) if (!strncmp (name, p->name, strlen (p->name)) && name[strlen (p->name)] == '/') - return 1; + { + const char *q = name + strlen (p->name) + 1; + + /* If there are more slashes, it's in a subdir, so + this match doesn't count. */ + while (*q) + if (*q++ == '/') + goto lose; + return 1; + + lose: ; + } return 0; } -- cgit v1.1