Treat ' as digit separator when file extension is .cpp, .cxx, .cc
This commit is contained in:
parent
6d3a04cfef
commit
e856bce4e9
10
flawfinder
10
flawfinder
|
@ -1461,6 +1461,7 @@ def process_c_file(f, patch_infos):
|
||||||
linenumber = 1
|
linenumber = 1
|
||||||
ignoreline = -1
|
ignoreline = -1
|
||||||
|
|
||||||
|
cpplanguage = f.endswith(".cpp") or f.endswith(".cxx") or f.endswith(".cc")
|
||||||
incomment = 0
|
incomment = 0
|
||||||
instring = 0
|
instring = 0
|
||||||
linebegin = 1
|
linebegin = 1
|
||||||
|
@ -1644,9 +1645,12 @@ def process_c_file(f, patch_infos):
|
||||||
startpos + max_lookahead]
|
startpos + max_lookahead]
|
||||||
hit.hook(hit)
|
hit.hook(hit)
|
||||||
elif p_digits.match(c):
|
elif p_digits.match(c):
|
||||||
while i < len(text) and p_digits.match(
|
while i < len(text): # Process a number.
|
||||||
text[i]): # Process a number.
|
# C does not have digit separator
|
||||||
i += 1
|
if p_digits.match(text[i]) or (cpplanguage and text[i] == "'"):
|
||||||
|
i += 1
|
||||||
|
else:
|
||||||
|
break
|
||||||
# else some other character, which we ignore.
|
# else some other character, which we ignore.
|
||||||
# End of loop through text. Wrap up.
|
# End of loop through text. Wrap up.
|
||||||
if codeinline:
|
if codeinline:
|
||||||
|
|
Loading…
Reference in New Issue