Make the script detect \r\n correctly.
Fix path traversal. Dots are escaped by % in Lua, not by \.