summaryrefslogtreecommitdiff
path: root/libcpp/mkdeps.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-30 15:50:00 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-30 15:50:00 +0000
commit09edb0e95545b518c77269a50324baf68fec9a48 (patch)
treed004a8fed5cf4b25dc5fa0fe8282aa85830423f0 /libcpp/mkdeps.c
parente0ff79356f763a6a1a5d6b519407ef66e19fa746 (diff)
downloadgcc-09edb0e95545b518c77269a50324baf68fec9a48.tar.gz
PR preprocessor/30468:
* mkdeps.c (apply_vpath): Strip successive '/'s if we stripped './'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121341 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/mkdeps.c')
-rw-r--r--libcpp/mkdeps.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libcpp/mkdeps.c b/libcpp/mkdeps.c
index 3e2c4d82e96..8aa96c529e3 100644
--- a/libcpp/mkdeps.c
+++ b/libcpp/mkdeps.c
@@ -1,5 +1,5 @@
/* Dependency generator for Makefile fragments.
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003, 2007 Free Software Foundation, Inc.
Contributed by Zack Weinberg, Mar 2000
This program is free software; you can redistribute it and/or modify it
@@ -141,7 +141,13 @@ apply_vpath (struct deps *d, const char *t)
/* Remove leading ./ in any case. */
while (t[0] == '.' && IS_DIR_SEPARATOR (t[1]))
- t += 2;
+ {
+ t += 2;
+ /* If we removed a leading ./, then also remove any /s after the
+ first. */
+ while (IS_DIR_SEPARATOR (t[0]))
+ ++t;
+ }
return t;
}