[Python-checkins] CVS: python/dist/src/Modules binascii.c,2.27,2.27.2.1

Moshe Zadka moshez@users.sourceforge.net
Sat, 31 Mar 2001 03:14:45 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv28421/Modules

Modified Files:
      Tag: release20-maint
	binascii.c 
Log Message:
Address a bug in the uuencode decoder, reported bu "donut" in SF bug
#127718: '@' and '`' seem to be confused.


Index: binascii.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/binascii.c,v
retrieving revision 2.27
retrieving revision 2.27.2.1
diff -C2 -r2.27 -r2.27.2.1
*** binascii.c	2000/09/01 23:29:26	2.27
--- binascii.c	2001/03/31 11:14:43	2.27.2.1
***************
*** 205,209 ****
  			** The 64 in stead of the expected 63 is because
  			** there are a few uuencodes out there that use
! 			** '@' as zero instead of space.
  			*/
  			if ( this_ch < ' ' || this_ch > (' ' + 64)) {
--- 205,209 ----
  			** The 64 in stead of the expected 63 is because
  			** there are a few uuencodes out there that use
! 			** '`' as zero instead of space.
  			*/
  			if ( this_ch < ' ' || this_ch > (' ' + 64)) {
***************
*** 233,238 ****
  	while( ascii_len-- > 0 ) {
  		this_ch = *ascii_data++;
! 		/* Extra '@' may be written as padding in some cases */
! 		if ( this_ch != ' ' && this_ch != '@' &&
  		     this_ch != '\n' && this_ch != '\r' ) {
  			PyErr_SetString(Error, "Trailing garbage");
--- 233,238 ----
  	while( ascii_len-- > 0 ) {
  		this_ch = *ascii_data++;
! 		/* 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");