瀏覽代碼

Fix infinite while loop on empty added file.

ajreckof 1 年之前
父節點
當前提交
d3d4b2e25e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      misc/scripts/copyright_headers.py

+ 1 - 1
misc/scripts/copyright_headers.py

@@ -73,7 +73,7 @@ for f in sys.argv[1:]:
         line = fileread.readline()
         line = fileread.readline()
         header_done = False
         header_done = False
 
 
-        while line.strip() == "":  # Skip empty lines at the top
+        while line.strip() == "" and line != "":  # Skip empty lines at the top
             line = fileread.readline()
             line = fileread.readline()
 
 
         if line.find("/**********") == -1:  # Godot header starts this way
         if line.find("/**********") == -1:  # Godot header starts this way