SVN commit 642305 by porten: decodeURI: don't drop last character of unescaped sequences M +5 -0 ChangeLog M +3 -2 function.cpp --- branches/KDE/3.5/kdelibs/kjs/ChangeLog #642304:642305 @@ -1,3 +1,8 @@ +2007-03-13 Harri Porten + + * function.cpp (decodeURI): don't drop last character of unescaped + (reserved) sequences. + 2007-02-24 Harri Porten * regexp.cpp: gracefully handle incomplete \u sequences in regular --- branches/KDE/3.5/kdelibs/kjs/function.cpp #642304:642305 @@ -284,9 +284,10 @@ decbuf[decbufLen++] = C; } else { - while (decbufLen+k-start >= decbufAlloc) + // copy unencoded sequence + while (decbufLen+k-start+1 >= decbufAlloc) decbuf = (UChar*)realloc(decbuf,(decbufAlloc *= 2)*sizeof(UChar)); - for (int p = start; p < k; p++) + for (int p = start; p <= k; p++) decbuf[decbufLen++] = string[p]; } }