Fix removal of first component

Removal of first component for header guard suggestion is hard-coded to
remove 4 characters ("src/").  This doesn't work with all directory
names ("unit/").
This commit is contained in:
Pascal Kesseli 2017-06-19 17:59:15 +01:00
parent e0b4515838
commit 78a23bbd69
1 changed files with 3 additions and 1 deletions

4
scripts/cpplint.py vendored
View File

@ -1967,7 +1967,9 @@ def GetHeaderGuardCPPVariable(filename):
fileinfo = FileInfo(filename)
file_path_from_root = fileinfo.RepositoryName()
file_path_from_root = 'CPROVER_' + file_path_from_root[4:]
# Remove first path component
offset=len(file_path_from_root.split(os.path.sep)[0])+1
file_path_from_root = 'CPROVER_' + file_path_from_root[offset:]
if _root:
suffix = os.sep
# On Windows using directory separator will leave us with