Skip to content

Commit

Permalink
fix bug in shell_parse and shell_split
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett authored and StefanKarpinski committed Sep 18, 2015
1 parent 3ed181f commit cd59221
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/shell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function shell_parse(raw::AbstractString, interp::Bool)
if done(s,k)
error("unterminated double quote")
end
if s[k] == '"' || s[k] == '$'
if s[k] == '"' || s[k] == '$' || s[k] == '\\'
update_arg(s[i:j-1]); i = k
c, k = next(s,k)
end
Expand Down
2 changes: 2 additions & 0 deletions test/spawn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,5 @@ end
let cmd = ["foo bar", "baz"]
@test string(`$cmd`) == "`'foo bar' baz`"
end

@test Base.shell_split("\"\\\\\"") == ["\\"]

0 comments on commit cd59221

Please sign in to comment.