From f6250b3a5af6aac7e366950f6c6826e4c18d4fbf Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 3 Mar 2015 20:16:38 +0000 Subject: [PATCH] * fixed handling of both #13#10 and #10 line separators when reading from the gdb/mi output on windows. Previous code only handled #13#10, but not #10. git-svn-id: trunk@30085 - --- ide/gdbmiproc.pas | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ide/gdbmiproc.pas b/ide/gdbmiproc.pas index 3eff9a2002..90b70589da 100644 --- a/ide/gdbmiproc.pas +++ b/ide/gdbmiproc.pas @@ -61,20 +61,21 @@ begin while FProcess.Running do begin FProcess.Output.Read(C, 1); - {$ifdef windows} - { On windows we expect both #13 and #10 } +{$ifdef windows} + { On windows we expect both #13#10 and #10 } if C = #13 then - begin - FPRocess.Output.Read(C,1); - {$endif windows} - if C = #10 then - begin - DebugLn(Result); - exit; - end; - {$ifdef windows} - end; - {$endif windows} + begin + FProcess.Output.Read(C, 1); + if C <> #10 then + { #13 not followed by #10, what should we do? } + Result := Result + #13; + end; +{$endif windows} + if C = #10 then + begin + DebugLn(Result); + exit; + end; Result := Result + C; end; end;