@@ -41,7 +41,6 @@ strop_split(self, args)
4141{
4242 int len , i , j , err ;
4343 char * s ;
44- char c ;
4544 object * list , * item ;
4645
4746 if (!getargs (args , "s#" , & s , & len ))
@@ -52,13 +51,11 @@ strop_split(self, args)
5251
5352 i = 0 ;
5453 while (i < len ) {
55- while (i < len &&
56- ((c = s [i ]), isspace (c ))) {
54+ while (i < len && isspace (Py_CHARMASK (s [i ]))) {
5755 i = i + 1 ;
5856 }
5957 j = i ;
60- while (i < len &&
61- !((c = s [i ]), isspace (c ))) {
58+ while (i < len && isspace (Py_CHARMASK (s [i ]))) {
6259 i = i + 1 ;
6360 }
6461 if (j < i ) {
@@ -269,20 +266,19 @@ strop_strip(self, args)
269266{
270267 char * s ;
271268 int len , i , j ;
272- char c ;
273269
274270 if (!getargs (args , "s#" , & s , & len ))
275271 return NULL ;
276272
277273 i = 0 ;
278- while (i < len && (( c = s [i ]), isspace ( c ))) {
274+ while (i < len && isspace ( Py_CHARMASK ( s [i ]))) {
279275 i ++ ;
280276 }
281277
282278 j = len ;
283279 do {
284280 j -- ;
285- } while (j >= i && (( c = s [ j ]), isspace ( c )));
281+ } while (j >= i && isspace ( Py_CHARMASK ( s [ i ] )));
286282 j ++ ;
287283
288284 if (i == 0 && j == len ) {
@@ -312,7 +308,7 @@ strop_lower(self, args)
312308 s_new = getstringvalue (new );
313309 changed = 0 ;
314310 for (i = 0 ; i < n ; i ++ ) {
315- char c = * s ++ ;
311+ int c = Py_CHARMASK ( * s ++ ) ;
316312 if (isupper (c )) {
317313 changed = 1 ;
318314 * s_new = tolower (c );
@@ -347,7 +343,7 @@ strop_upper(self, args)
347343 s_new = getstringvalue (new );
348344 changed = 0 ;
349345 for (i = 0 ; i < n ; i ++ ) {
350- char c = * s ++ ;
346+ int c = Py_CHARMASK ( * s ++ ) ;
351347 if (islower (c )) {
352348 changed = 1 ;
353349 * s_new = toupper (c );
@@ -382,7 +378,7 @@ strop_swapcase(self, args)
382378 s_new = getstringvalue (new );
383379 changed = 0 ;
384380 for (i = 0 ; i < n ; i ++ ) {
385- char c = * s ++ ;
381+ int c = Py_CHARMASK ( * s ++ ) ;
386382 if (islower (c )) {
387383 changed = 1 ;
388384 * s_new = toupper (c );
@@ -530,7 +526,7 @@ initstrop()
530526
531527 /* Create 'whitespace' object */
532528 n = 0 ;
533- for (c = 1 ; c < 256 ; c ++ ) {
529+ for (c = 0 ; c < 256 ; c ++ ) {
534530 if (isspace (c ))
535531 buf [n ++ ] = c ;
536532 }
@@ -541,7 +537,7 @@ initstrop()
541537 }
542538 /* Create 'lowercase' object */
543539 n = 0 ;
544- for (c = 1 ; c < 256 ; c ++ ) {
540+ for (c = 0 ; c < 256 ; c ++ ) {
545541 if (islower (c ))
546542 buf [n ++ ] = c ;
547543 }
@@ -553,7 +549,7 @@ initstrop()
553549
554550 /* Create 'uppercase' object */
555551 n = 0 ;
556- for (c = 1 ; c < 256 ; c ++ ) {
552+ for (c = 0 ; c < 256 ; c ++ ) {
557553 if (isupper (c ))
558554 buf [n ++ ] = c ;
559555 }
0 commit comments