projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8b91ab8
)
Fix K-Escaper; we wouldn't copy the whole UTF-8 sequence in some cases.
author
Wilfried Goesgens
<dothebart@citadel.org>
Wed, 29 Jun 2011 09:56:50 +0000
(11:56 +0200)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Wed, 29 Jun 2011 09:58:28 +0000
(11:58 +0200)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index 1408669b0bf90810e78a1ac819f95fa60526e7ba..7a841df8f255fcdbfd5c20348639aa2387348a18 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-2153,20
+2153,20
@@
long StrHtmlEcmaEscAppend(StrBuf *Target, const StrBuf *Source, const char *Plai
if (((unsigned char)*aptr) >= 0x20)
{
IsUtf8Sequence = Ctdl_GetUtf8SequenceLength(aptr, eiptr);
if (((unsigned char)*aptr) >= 0x20)
{
IsUtf8Sequence = Ctdl_GetUtf8SequenceLength(aptr, eiptr);
-
+
*bptr = *aptr;
Target->BufUsed ++;
*bptr = *aptr;
Target->BufUsed ++;
-
while (IsUtf8Sequence > 1
){
- if(bptr + IsUtf8Sequence >= eptr) {
- IncreaseBuf(Target, 1, -1);
- eptr = Target->buf + Target->BufSize - 11; /* our biggest unit to put in... */
- bptr = Target->buf + Target->BufUsed - 1;
- }
+
if (IsUtf8Sequence > 1) while (IsUtf8Sequence > 0
){
+
if(bptr + IsUtf8Sequence >= eptr) {
+
IncreaseBuf(Target, 1, -1);
+
eptr = Target->buf + Target->BufSize - 11; /* our biggest unit to put in... */
+
bptr = Target->buf + Target->BufUsed - 1;
+
}
bptr++; aptr++;
bptr++; aptr++;
- IsUtf8Sequence --;
- *bptr = *aptr;
- Target->BufUsed ++;
- }
+
IsUtf8Sequence --;
+
*bptr = *aptr;
+
Target->BufUsed ++;
+
}
bptr++;
}
bptr++;
}