Skip to content

Commit 657e056

Browse files
committed
workaround for broken Peek() method in StreamReader
1 parent c906571 commit 657e056

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/MakoIoT.Device.Services.FileStorage/MakoStreamReader.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,10 @@ public override string ReadLine()
385385
return new string(readLineBuff, 0, curPos);
386386
}
387387

388-
// check for \r and \r\n
388+
// skip \r and wait for \n, we can't use Peek() because it's broken :(
389389
if (readLineBuff[curPos] == '\r')
390390
{
391-
// If the next character is \n eat it
392-
if (Peek() == '\n')
393-
{
394-
_ = Read();
395-
}
396-
397-
return new string(readLineBuff, 0, curPos);
391+
continue;
398392
}
399393

400394
// move to the next byte

0 commit comments

Comments
 (0)