summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-22 14:13:45 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-22 14:13:45 -0500
commit599c219a182222c5ca0c9cf371e2a7f12e3b9c14 (patch)
tree7a9d14f12bae5fcdc764904a95ea2d9f94a69bb1
parent92f78e5c9e2101e44628f4a2ae17ed6edcb98f66 (diff)
downloaddeheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.tar.gz
deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.tar.bz2
deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.tar.xz
deheader-599c219a182222c5ca0c9cf371e2a7f12e3b9c14.zip
Prevent false match on C++ method names.
-rwxr-xr-xdeheader4
1 files changed, 3 insertions, 1 deletions
diff --git a/deheader b/deheader
index 6b7df63..22faa10 100755
--- a/deheader
+++ b/deheader
@@ -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))