From 6ff943b5024b9ef57f94feb466dabeb55257fe2e Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Thu, 18 Apr 2024 22:06:16 +0200 Subject: [PATCH] Test failure scenario --- src/Renci.SshNet/Renci.SshNet.csproj | 6 +++++- src/Renci.SshNet/SshCommand.cs | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Renci.SshNet/Renci.SshNet.csproj b/src/Renci.SshNet/Renci.SshNet.csproj index 00daaa85..585eb460 100644 --- a/src/Renci.SshNet/Renci.SshNet.csproj +++ b/src/Renci.SshNet/Renci.SshNet.csproj @@ -30,7 +30,7 @@ - + @@ -44,4 +44,8 @@ + + + + diff --git a/src/Renci.SshNet/SshCommand.cs b/src/Renci.SshNet/SshCommand.cs index df61cda7..deaddd18 100644 --- a/src/Renci.SshNet/SshCommand.cs +++ b/src/Renci.SshNet/SshCommand.cs @@ -5,9 +5,12 @@ using System.Runtime.ExceptionServices; using System.Text; using System.Threading; +using CsvHelper; + using Renci.SshNet.Abstractions; using Renci.SshNet.Channels; using Renci.SshNet.Common; +using Renci.SshNet.Messages; using Renci.SshNet.Messages.Connection; using Renci.SshNet.Messages.Transport; @@ -118,8 +121,12 @@ namespace Renci.SshNet detectEncodingFromByteOrderMarks: true, bufferSize: 1024, leaveOpen: true)) + using (var csv = new CsvReader(sr, CultureInfo.InvariantCulture)) { - _ = _result.Append(sr.ReadToEnd()); + foreach (var m in csv.GetRecords()) + { + _ = _result.Append(m); + } } }