[Python-checkins] python/dist/src/Objects stringobject.c,2.187,2.188
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Sun, 08 Sep 2002 23:17:07 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv964/Objects
Modified Files:
stringobject.c
Log Message:
Fix escaping of non-ASCII characters.
Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.187
retrieving revision 2.188
diff -C2 -d -r2.187 -r2.188
*** stringobject.c 3 Sep 2002 13:53:40 -0000 2.187
--- stringobject.c 9 Sep 2002 06:17:05 -0000 2.188
***************
*** 542,545 ****
--- 542,546 ----
while (s < end) {
if (*s != '\\') {
+ non_esc:
#ifdef Py_USING_UNICODE
if (recode_encoding && (*s & 0x80)) {
***************
*** 657,662 ****
default:
*p++ = '\\';
! *p++ = s[-1];
! break;
}
}
--- 658,664 ----
default:
*p++ = '\\';
! s--;
! goto non_esc; /* an arbitry number of unescaped
! UTF-8 bytes may follow. */
}
}