diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-12-22 14:13:45 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-12-22 14:13:45 -0500 |
commit | 599c219a182222c5ca0c9cf371e2a7f12e3b9c14 (patch) | |
tree | 7a9d14f12bae5fcdc764904a95ea2d9f94a69bb1 | |
parent | 92f78e5c9e2101e44628f4a2ae17ed6edcb98f66 (diff) | |
download | deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.tar.gz deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.tar.bz2 deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.tar.xz deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.zip |
Prevent false match on C++ method names.
-rwxr-xr-x | deheader | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1150,7 +1150,9 @@ class InclusionMap: compiled = [] for (r, h) in requirements: if r.endswith("()"): - c = re.compile(r"\W" + r.replace("()", r"\s*\(")) + # The prefix is intended to exclude false suffix matches: + # also, excluding : prevents matching on C++ method names. + c = re.compile(r"[^a-zA-Z0-9:_]" + r.replace("()", r"\s*\(")) else: c = re.compile(r) compiled.append((r, c, h)) |