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

Guido van Rossum python-dev@python.org
Mon, 08 Jan 2001 18:11:59 -0800


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

Modified Files:
	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.28
diff -C2 -r2.27 -r2.28
*** binascii.c	2000/09/01 23:29:26	2.27
--- binascii.c	2001/01/09 02:11:57	2.28
***************
*** 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");