From 478033988a7331a1501a8e663bc507a2e94775f9 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 25 Nov 2016 17:27:15 +0000 Subject: [PATCH] improve parsing of initial and ending, fix pasing of quoted quotes as well git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@40238 72102866-910b-0410-8b05-ffd578937521 --- Modules/Debuggers/ProjectCenter/PipeDelegate.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/Debuggers/ProjectCenter/PipeDelegate.m b/Modules/Debuggers/ProjectCenter/PipeDelegate.m index c613b1a..ebd249f 100644 --- a/Modules/Debuggers/ProjectCenter/PipeDelegate.m +++ b/Modules/Debuggers/ProjectCenter/PipeDelegate.m @@ -324,9 +324,11 @@ { NSString *unescapedString = [recordString copy]; - unescapedString = [unescapedString stringByReplacingOccurrencesOfString: @"~\"" withString: @""]; - unescapedString = [unescapedString substringToIndex: [unescapedString length] - 1]; - unescapedString = [unescapedString stringByReplacingOccurrencesOfString: @"\"" withString: @"\""]; + if ([unescapedString hasPrefix:@"~\""]) + unescapedString = [unescapedString substringFromIndex:2]; + if ([unescapedString hasSuffix:@"\""])\ + unescapedString = [unescapedString substringToIndex: [unescapedString length] - 1]; + unescapedString = [unescapedString stringByReplacingOccurrencesOfString: @"\\\"" withString: @"\""]; unescapedString = [unescapedString stringByReplacingOccurrencesOfString: @"\\n" withString: @"\n"]; unescapedString = [unescapedString stringByReplacingOccurrencesOfString: @"\\t" withString: @"\t"]; unescapedString = [unescapedString stringByReplacingOccurrencesOfString: @"\\032" withString: @" "]; @@ -346,7 +348,7 @@ if(outtype == PCDBConsoleStreamRecord || outtype == PCDBTargetStreamRecord) { - NSString *unescapedString = [self unescapeOutputRecord: item]; + NSString *unescapedString = [self unescapeOutputRecord: item]; [self logString: unescapedString newLine: NO withColor:debuggerColor]; } else if(outtype == PCDBPromptRecord)