mirror of
https://github.com/godotengine/godot.git
synced 2024-12-21 10:25:24 +08:00
Merge pull request #100167 from AshWolf/header-guards-crash-fix
Fix crash within header_guards when a file is too short
This commit is contained in:
commit
d6473dd3fa
@ -36,11 +36,16 @@ for file in sys.argv[1:]:
|
||||
break
|
||||
|
||||
if HEADER_CHECK_OFFSET < 0:
|
||||
invalid.append(file)
|
||||
continue
|
||||
|
||||
HEADER_BEGIN_OFFSET = HEADER_CHECK_OFFSET + 1
|
||||
HEADER_END_OFFSET = len(lines) - 1
|
||||
|
||||
if HEADER_BEGIN_OFFSET >= HEADER_END_OFFSET:
|
||||
invalid.append(file)
|
||||
continue
|
||||
|
||||
split = file.split("/") # Already in posix-format.
|
||||
|
||||
prefix = ""
|
||||
|
Loading…
Reference in New Issue
Block a user