Skip to content

Commit 9c4ef33

Browse files
committed
♻️ Anchor literal regexp to the end of the buffer
This also allows us to check against the concatenated buffer, rather than the smaller line buffer. That distinction doesn't really matter now, since we always read an entire line at once. But it will matter if we read partial lines.
1 parent 4146790 commit 9c4ef33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/imap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3437,7 +3437,7 @@ def get_response
34373437
s = @sock.gets(CRLF)
34383438
break unless s
34393439
buff.concat(s)
3440-
if /\{(\d+)\}\r\n/n =~ s
3440+
if /\{(\d+)\}\r\n\z/n =~ buff
34413441
s = @sock.read($1.to_i)
34423442
buff.concat(s)
34433443
else

0 commit comments

Comments
 (0)