Skip to content

Commit bf38384

Browse files
committed
Simplified reading of IMAP atom tokens
1 parent 30b32a9 commit bf38384

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

MailKit/Net/Imap/ImapStream.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ enum ImapStreamMode {
6161

6262
class ImapStream : Stream, ICancellableStream
6363
{
64-
public const string AtomSpecials = "(){%*\\\"\n";
64+
public const string AtomSpecials = "(){%*\\\"";
6565
public const string DefaultSpecials = "[]" + AtomSpecials;
6666
const int ReadAheadSize = 128;
6767
const int BlockSize = 4096;
@@ -524,7 +524,7 @@ public override async Task<int> ReadAsync (byte[] buffer, int offset, int count,
524524

525525
static bool IsAtom (byte c, string specials)
526526
{
527-
return !IsCtrl (c) && !IsWhiteSpace (c) && specials.IndexOf ((char) c) == -1;
527+
return !IsCtrl (c) && c != (byte) ' ' && specials.IndexOf ((char) c) == -1;
528528
}
529529

530530
static bool IsCtrl (byte c)
@@ -534,7 +534,7 @@ static bool IsCtrl (byte c)
534534

535535
static bool IsWhiteSpace (byte c)
536536
{
537-
return c == (byte) ' ' || c == (byte) '\t' || c == (byte) '\r';
537+
return c == (byte) ' ' || c == (byte) '\r';
538538
}
539539

540540
bool TryReadQuotedString (ByteArrayBuilder builder, ref bool escaped)

0 commit comments

Comments
 (0)