diff Objects/unicodeobject.c @ 12544:599bfa4ffd49 legacy-trunk

Marc-Andre Lemburg: Fixed \OOO interpretation for Unicode objects. \777 now correctly produces the Unicode character with ordinal 511.
author Guido van Rossum <guido@python.org>
date Mon, 01 May 2000 21:27:20 +0000
parents 8747f1c8b5fb
children 1be2331588b2
line wrap: on
line diff
--- a/Objects/unicodeobject.c	Mon May 01 20:19:08 2000 +0000
+++ b/Objects/unicodeobject.c	Mon May 01 21:27:20 2000 +0000
@@ -1016,13 +1016,13 @@
         /* \OOO (octal) escapes */
         case '0': case '1': case '2': case '3':
         case '4': case '5': case '6': case '7':
-            c = s[-1] - '0';
+            x = s[-1] - '0';
             if ('0' <= *s && *s <= '7') {
-                c = (c<<3) + *s++ - '0';
+                x = (x<<3) + *s++ - '0';
                 if ('0' <= *s && *s <= '7')
-                    c = (c<<3) + *s++ - '0';
+                    x = (x<<3) + *s++ - '0';
             }
-            *p++ = c;
+            *p++ = x;
             break;
 
         /* \xXXXX escape with 0-4 hex digits */