diff options
author | Tom Tromey <tromey@redhat.com> | 2007-01-30 15:50:00 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-30 15:50:00 +0000 |
commit | 67e644395802294de723b8cafcf01cf153e47684 (patch) | |
tree | d004a8fed5cf4b25dc5fa0fe8282aa85830423f0 /libcpp | |
parent | ee380365ef32d718116976cc15eebbe7624cc267 (diff) | |
download | gcc-67e644395802294de723b8cafcf01cf153e47684.zip gcc-67e644395802294de723b8cafcf01cf153e47684.tar.gz gcc-67e644395802294de723b8cafcf01cf153e47684.tar.bz2 |
re PR preprocessor/30468 (-M not fully chops dirname)
PR preprocessor/30468:
* mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
'./'.
From-SVN: r121341
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 6 | ||||
-rw-r--r-- | libcpp/mkdeps.c | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 40c216b..ea5f1ff 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,5 +1,11 @@ 2007-01-30 Tom Tromey <tromey@redhat.com> + PR preprocessor/30468: + * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped + './'. + +2007-01-30 Tom Tromey <tromey@redhat.com> + PR preprocessor/29966: * macro.c (lex_expansion_token): Save and restore cpp_reader's cur_token. diff --git a/libcpp/mkdeps.c b/libcpp/mkdeps.c index 3e2c4d8..8aa96c5 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; } |