From af7d3064818b9d87fd05b3d46045d0dc36fc87ad Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Thu, 22 Jul 2004 14:27:39 +0000 Subject: [PATCH] Tweak old style property list output format. tab, cr, nl characters in a quoteed string should not need escaping, thoiugh escaped versions need to be understood on input. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19768 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSPropertyList.m | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f201d84a7..c5756181e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-07-22 Richard Frith-Macdonald + + * Source/NSPropertyList.m: don't escape tab,cr,lf in output of old + style property lists. + 2004-07-21 David Ayers * Source/Additions/GSObjCRuntime.m diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index 309b0916f..5e8847cde 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -1237,11 +1237,14 @@ PString(NSString *obj, NSMutableData *output) { switch (*from) { - case '\a': - case '\b': case '\t': case '\r': case '\n': + len++; + break; + + case '\a': + case '\b': case '\v': case '\f': case '\\': @@ -1277,11 +1280,14 @@ PString(NSString *obj, NSMutableData *output) { switch (*from) { + case '\t': + case '\r': + case '\n': + *ptr++ = *from; + break; + case '\a': *ptr++ = '\\'; *ptr++ = 'a'; break; case '\b': *ptr++ = '\\'; *ptr++ = 'b'; break; - case '\t': *ptr++ = '\\'; *ptr++ = 't'; break; - case '\r': *ptr++ = '\\'; *ptr++ = 'r'; break; - case '\n': *ptr++ = '\\'; *ptr++ = 'n'; break; case '\v': *ptr++ = '\\'; *ptr++ = 'v'; break; case '\f': *ptr++ = '\\'; *ptr++ = 'f'; break; case '\\': *ptr++ = '\\'; *ptr++ = '\\'; break;