[Python-checkins] python/dist/src/Objects typeobject.c,2.158,2.159

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Tue, 16 Jul 2002 07:30:31 -0700


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

Modified Files:
	typeobject.c 
Log Message:
valid_identifier(): use an unsigned char* so that isalpha() will do
the right thing even if char is unsigned.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.158
retrieving revision 2.159
diff -C2 -d -r2.158 -r2.159
*** typeobject.c	11 Jul 2002 06:23:50 -0000	2.158
--- typeobject.c	16 Jul 2002 14:30:28 -0000	2.159
***************
*** 963,967 ****
  valid_identifier(PyObject *s)
  {
! 	char *p;
  	int i, n;
  
--- 963,967 ----
  valid_identifier(PyObject *s)
  {
! 	unsigned char *p;
  	int i, n;
  
***************
*** 971,975 ****
  		return 0;
  	}
! 	p = PyString_AS_STRING(s);
  	n = PyString_GET_SIZE(s);
  	/* We must reject an empty name.  As a hack, we bump the
--- 971,975 ----
  		return 0;
  	}
! 	p = (unsigned char *) PyString_AS_STRING(s);
  	n = PyString_GET_SIZE(s);
  	/* We must reject an empty name.  As a hack, we bump the