Skip to content

Commit

Permalink
workaround for broken Peek() method in StreamReader
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzman55 committed Dec 17, 2024
1 parent c906571 commit 657e056
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/MakoIoT.Device.Services.FileStorage/MakoStreamReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,10 @@ public override string ReadLine()
return new string(readLineBuff, 0, curPos);
}

// check for \r and \r\n
// skip \r and wait for \n, we can't use Peek() because it's broken :(
if (readLineBuff[curPos] == '\r')
{
// If the next character is \n eat it
if (Peek() == '\n')
{
_ = Read();
}

return new string(readLineBuff, 0, curPos);
continue;
}

// move to the next byte
Expand Down

0 comments on commit 657e056

Please sign in to comment.