fix wmllint-crashing map_data= bug involving empty quotes

wmllint crashes if the value for the map_data key consists of unfilled quotation marks (""), just as it does if there are no quotation marks:

----
Traceback (most recent call last):
  File "data/tools/wmllint", line 1917, in translator
    outmap = [outmap[0]] + outmap + [outmap[-1]]
IndexError: list index out of range
----

This simple fix checks to make sure that there are no side-by-side quotation marks on the line.

I also tidied up a double-space two lines down.
This commit is contained in:
Groggy Dice 2013-06-25 21:52:34 -04:00
parent 419fabdad8
commit 8dc3bed61f

View file

@ -1816,8 +1816,9 @@ def translator(filename, mapxforms, textxform):
# refer to map files which will be checked separately.
if map_only or (("map_data=" in line or "mask=" in line)
and line.count('"') in (1, 2)
and line.count('""') == 0
and line.count("{") == 0
and line.count("}") == 0
and line.count("}") == 0
and not within('time')):
outmap = []
add_border = True