From 97b5e1c1790dc474f85e403477a6e076c29b28c6 Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 13 Jun 2008 14:19:23 +0000 Subject: [PATCH] Another attempt at getting buffer growth right git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26645 72102866-910b-0410-8b05-ffd578937521 --- Source/Additions/Unicode.m | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Source/Additions/Unicode.m b/Source/Additions/Unicode.m index 9478e2840..a300eb5ef 100644 --- a/Source/Additions/Unicode.m +++ b/Source/Additions/Unicode.m @@ -723,14 +723,11 @@ if (dst == 0) \ * reset the offset into the local buffer on the \ * stack and pretend the buffer has grown. \ */ \ - ptr = buf - bsize; \ - if (extra == 0) \ + ptr = buf - dpos; \ + bsize = dpos + BUFSIZ; \ + if (extra != 0) \ { \ - bsize += BUFSIZ; \ - } \ - else \ - { \ - bsize += BUFSIZ-1; \ + bsize--; \ } \ } \ else if (zone == 0) \ @@ -1247,14 +1244,11 @@ if (dst == 0) \ * reset the offset into the local buffer on the \ * stack and pretend the buffer has grown. \ */ \ - ptr = buf - bsize; \ - if (extra == 0) \ + ptr = buf - dpos; \ + bsize = dpos + BUFSIZ; \ + if (extra != 0) \ { \ - bsize += BUFSIZ; \ - } \ - else \ - { \ - bsize += BUFSIZ-1; \ + bsize--; \ } \ } \ else if (zone == 0) \