[Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.12,2.13

Guido van Rossum python-dev@python.org
Mon, 1 May 2000 17:27:23 -0400 (EDT)


Update of /projects/cvsroot/python/dist/src/Objects
In directory eric:/projects/python/develop/guido/src/Objects

Modified Files:
	unicodeobject.c 
Log Message:
Marc-Andre Lemburg:

Fixed \OOO interpretation for Unicode objects. \777 now
correctly produces the Unicode character with ordinal 511.


Index: unicodeobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.12
retrieving revision 2.13
diff -C2 -r2.12 -r2.13
*** unicodeobject.c	2000/04/27 20:13:50	2.12
--- unicodeobject.c	2000/05/01 21:27:20	2.13
***************
*** 1017,1027 ****
          case '0': case '1': case '2': case '3':
          case '4': case '5': case '6': case '7':
!             c = s[-1] - '0';
              if ('0' <= *s && *s <= '7') {
!                 c = (c<<3) + *s++ - '0';
                  if ('0' <= *s && *s <= '7')
!                     c = (c<<3) + *s++ - '0';
              }
!             *p++ = c;
              break;
  
--- 1017,1027 ----
          case '0': case '1': case '2': case '3':
          case '4': case '5': case '6': case '7':
!             x = s[-1] - '0';
              if ('0' <= *s && *s <= '7') {
!                 x = (x<<3) + *s++ - '0';
                  if ('0' <= *s && *s <= '7')
!                     x = (x<<3) + *s++ - '0';
              }
!             *p++ = x;
              break;