Merge 4be04548c80a807039bd77b759067e12f8d9ff0c into 8487c083e1faecb1259be8a8873618cfdb69d33d

This commit is contained in:
Ryo Takahashi 2024-03-19 10:46:36 -03:00 committed by GitHub
commit 699b194487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

6
cpplint/cpplint.py vendored
View File

@ -6068,6 +6068,12 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
else:
lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n')
# Remove BOM
if lines and lines[0]:
ord0 = ord(lines[0][0])
if ord0 == 0xfeff:
lines[0] = lines[0][1:]
# Remove trailing '\r'.
# The -1 accounts for the extra trailing blank line we get from split()
for linenum in range(len(lines) - 1):