aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-03-04 00:22:42 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-03-04 00:25:59 +0100
commit41222364c4a6ba9e515df5eee96ae6262735fdc6 (patch)
treec02561191ec65386b6386a59edbf26d4139330dd
parentacc5c29877eff97d2c8dec9319d27f9dcb699a69 (diff)
parentebda8ec1c00447a6845ce50e9f272624948f810f (diff)
downloadsparse-41222364c4a6ba9e515df5eee96ae6262735fdc6.tar.gz
Merge branch 'path-norm'
* pre-processing: strip leading "./" from include paths
-rw-r--r--pre-process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pre-process.c b/pre-process.c
index 7a1478f6..3fb25082 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -884,6 +884,12 @@ static void set_stream_include_path(struct stream *stream)
memcpy(m, stream->name, len);
m[len] = 0;
path = m;
+ /* normalize this path */
+ while (path[0] == '.' && path[1] == '/') {
+ path += 2;
+ while (path[0] == '/')
+ path++;
+ }
}
stream->path = path;
}