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
|
||||
ignoreline = -1
|
||||
|
||||
cpplanguage = f.endswith(".cpp") or f.endswith(".cxx") or f.endswith(".cc")
|
||||
incomment = 0
|
||||
instring = 0
|
||||
linebegin = 1
|
||||
|
@ -1644,9 +1645,12 @@ def process_c_file(f, patch_infos):
|
|||
startpos + max_lookahead]
|
||||
hit.hook(hit)
|
||||
elif p_digits.match(c):
|
||||
while i < len(text) and p_digits.match(
|
||||
text[i]): # Process a number.
|
||||
i += 1
|
||||
while i < len(text): # Process a number.
|
||||
# C does not have digit separator
|
||||
if p_digits.match(text[i]) or (cpplanguage and text[i] == "'"):
|
||||
i += 1
|
||||
else:
|
||||
break
|
||||
# else some other character, which we ignore.
|
||||
# End of loop through text. Wrap up.
|
||||
if codeinline:
|
||||
|
|
Loading…
Reference in New Issue