Phanx / wow-addon-updater

Install and update World of Warcraft addons from the command line on Linux
zlib License
4 stars 1 forks source link

Enable compatibility with Lua 5.3.4 (latest version) #1

Closed jukx closed 6 years ago

jukx commented 6 years ago

When I run lua update.lua with Lua 5.3.4 I get the following error message:

lua: sites.lua:233: invalid escape sequence near ''<a href="fileinfo.php\?'
stack traceback:
    [C]: in function 'dofile'
    update.lua:11: in main chunk
    [C]: in ?

Can be fixed by escaping the backslash. Line 233 in sites.lua would be local id, name = tr:match('<a href="fileinfo.php}\\?[^"]*id=(%d+)[^"]*">(.-)</a>') then.

This doesn't seem to affect Lua 5.1 negatively, as far as I can see.

Disclaimer: I have only tested update.lua so far. Edit: I forgot that I fixed another string earlier: line 94 of sites.lua the backslash has to be removed. It then reads: if url:find("/downloads/landing\.php") then

jukx commented 6 years ago

Added pull request if needed: #6

Phanx commented 6 years ago

Actually this one was caused by me escaping things with a backslash out of habit (I primarily work in JavaScript) instead of a percent sign.