From aea14d8dd4fade2beef37e319aa25dbdf2c5288e Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 27 Apr 2023 17:57:05 -0400 Subject: [PATCH] bug - CDATA notes in the software list weren't handled correctly (not used for apple family) --- Ample/SoftwareList.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Ample/SoftwareList.m b/Ample/SoftwareList.m index 0ad4272..6cb1e90 100644 --- a/Ample/SoftwareList.m +++ b/Ample/SoftwareList.m @@ -333,9 +333,13 @@ if (_state & 0b1000) { // notes - NSString *string = [[NSString new] initWithData: CDATABlock encoding: NSUTF8StringEncoding]; + NSString *string = [[NSString alloc] initWithData: CDATABlock encoding: NSUTF8StringEncoding]; - if (_scratch) _notes = [_scratch stringByAppendingString: string]; + string = [string stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (_scratch) { + _scratch = [_scratch stringByAppendingString: @"\n"]; + _scratch = [_scratch stringByAppendingString: string]; + } else _scratch = string; } }