mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
practracker/includes.py: Don't read editor temp files
(Or any files that start with "." or "#".) Obviously correct changes to already-reviewed code.
This commit is contained in:
parent
3669a2f827
commit
fadd292bf0
@ -36,7 +36,11 @@ def warn(msg):
|
||||
def fname_is_c(fname):
|
||||
""" Return true iff 'fname' is the name of a file that we should
|
||||
search for possibly disallowed #include directives. """
|
||||
return fname.endswith(".h") or fname.endswith(".c")
|
||||
if fname.endswith(".h") or fname.endswith(".c"):
|
||||
bname = os.path.basename(fname)
|
||||
return not (bname.startswith(".") or bname.startswith("#"))
|
||||
else:
|
||||
return False
|
||||
|
||||
INCLUDE_PATTERN = re.compile(r'\s*#\s*include\s+"([^"]*)"')
|
||||
RULES_FNAME = ".may_include"
|
||||
|
Loading…
Reference in New Issue
Block a user