Skip to content

Commit

Permalink
fixed a file-not-found error when dropping a file with spaces on patc…
Browse files Browse the repository at this point in the history
…h and patch-wad console windows
  • Loading branch information
glankk committed Feb 21, 2018
1 parent e5413d7 commit 6f9bbd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions patch/lua/patch-wad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ if #arg < 1 then
print("usage: `patch-wad <wad-file>` " ..
"(or drag and drop a wad onto the patch script)")
local line = io.read()
if line ~= nil and line:sub(1, 1) == "\"" and line:sub(-1, -1) == "\"" then
line = line:sub(2, -2)
end
if line == nil or line == "" then return end
arg[1] = line
end
Expand Down
3 changes: 3 additions & 0 deletions patch/lua/patch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ if #arg < 1 then
print("usage: `patch <rom-file>` " ..
"(or drag and drop a rom onto the patch script)")
local line = io.read()
if line ~= nil and line:sub(1, 1) == "\"" and line:sub(-1, -1) == "\"" then
line = line:sub(2, -2)
end
if line == nil or line == "" then return end
arg[1] = line
end
Expand Down

0 comments on commit 6f9bbd2

Please sign in to comment.