From d0851885c6af2e4d5381950a9d996d8d372b7532 Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Sat, 31 Mar 2001 11:14:43 +0000 Subject: Address a bug in the uuencode decoder, reported bu "donut" in SF bug #127718: '@' and '`' seem to be confused. --- Misc/NEWS | 2 ++ Modules/binascii.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 7651974..67430a2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -103,6 +103,8 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=&group_id=5470&atid - mpzmodule.c - make .binary() work on 64-bit system, make it compile with Cygwin +- #127718 - '@' were '`' seem to be confused. + What's New in Python 2.0? ========================= diff --git a/Modules/binascii.c b/Modules/binascii.c index 010e22d..85edd04 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -204,7 +204,7 @@ binascii_a2b_uu(PyObject *self, PyObject *args) /* Check the character for legality ** The 64 in stead of the expected 63 is because ** there are a few uuencodes out there that use - ** '@' as zero instead of space. + ** '`' as zero instead of space. */ if ( this_ch < ' ' || this_ch > (' ' + 64)) { PyErr_SetString(Error, "Illegal char"); @@ -232,8 +232,8 @@ binascii_a2b_uu(PyObject *self, PyObject *args) */ while( ascii_len-- > 0 ) { this_ch = *ascii_data++; - /* Extra '@' may be written as padding in some cases */ - if ( this_ch != ' ' && this_ch != '@' && + /* Extra '`' may be written as padding in some cases */ + if ( this_ch != ' ' && this_ch != ' '+64 && this_ch != '\n' && this_ch != '\r' ) { PyErr_SetString(Error, "Trailing garbage"); Py_DECREF(rv); -- cgit v0.12