Skip to content

Commit

Permalink
Escape braces after all in cmd/brace encoder
Browse files Browse the repository at this point in the history
Previously escaped only commas.
  • Loading branch information
wvu authored May 26, 2023
1 parent d825515 commit f5bec51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/encoders/cmd/brace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def encode_block(state, buf)
return buf if state.badchars !~ /\s/

# Perform brace expansion encoding
"{#{buf.gsub(',', '\\,').gsub(/\s+/, ',')}}"
"{#{buf.gsub(/([{,}])/, '\\\\\1').gsub(/\s+/, ',')}}"
end

end

0 comments on commit f5bec51

Please sign in to comment.