Fix newline processing, add changelog

This commit is contained in:
Matt Nadareski
2021-06-15 10:20:13 -07:00
parent 972b07551f
commit c91137130b
2 changed files with 15 additions and 6 deletions

View File

@@ -9,6 +9,9 @@
- Be smarter about checking for zipped logs
- Change offset value for HVN discs
- Update to DIC 20210601
- Fix Aaru command normalization
- Handle carriage returns better
- Add logging helper class
### 2.0 (2021-04-23)
- Rename DICUI to Media Preservation Frontend (MPF)

View File

@@ -77,18 +77,24 @@ namespace MPF.Utilities
continue;
}
// For all except the last, just keep appending to the builder
if (i < split.Length - 1)
// For the first item, append to anything existing and then write out
if (i == 0)
{
sb.Append(split[i]);
handler?.Invoke(baseClass, sb.ToString());
sb.Clear();
}
// For the last item, just append so it's dealt with the next time
else if (i == split.Length - 1)
{
sb.Append(split[i]);
}
// For the last item, write out and then put the remainder in the builder
// For everything else, directly write out
else
{
handler?.Invoke(baseClass, sb.ToString());
sb.Clear();
sb.Append(split[i]);
handler?.Invoke(baseClass, split[i]);
}
}
}