Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/net/imap/command_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def send_data(data, tag = nil)
end
end

UNQUOTABLE_CHARS = /\0\r\n/
UNQUOTABLE_CHARS = /[\0\r\n]/
ASTRING_SPECIALS = /[(){ \x00-\x1f\x7f%*"\\]/
private_constant :UNQUOTABLE_CHARS, :ASTRING_SPECIALS

Expand Down
4 changes: 4 additions & 0 deletions test/net/imap/test_imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,10 @@ def imap.test_args(*args) = send_command("TEST", *args)
send_args.call ["\xDE\xAD\xBE\xEF".b]
assert_equal "({4}\r\n\xDE\xAD\xBE\xEF)".b, server.commands.pop.args

send_args.call ["hi\rthere\n", "huh?\r\nfake out"]
assert_equal "({9}\r\nhi\rthere\n {14}\r\nhuh?\r\nfake out)".b,
server.commands.pop.args

# enable automatic non-synchronizing literals
imap.config.max_non_synchronizing_literal = 1024
buff = bytes = nil
Expand Down