At 22:10 24-10-2002, Ilia A. wrote:
The lower/upper code uses libc's tolower/toupper functions, as long as the specified locale is supported and the entered text is considered to be alphabetic based on the entered locale the code will and does work correctly.
Except - the cast!
This makes things work again on my FreeBSD box, will test it for BSDi in a minute, but I'm pretty sure it's going to work there also. Is there any specific reason this cast has been removed from the 4.2.3 version? If so - we should work this in at a preprocessor level somehow (generically as I recall the test failing on AIX also). Index: ext/standard/string.c =================================================================== RCS file: /repository/php4/ext/standard/string.c,v retrieving revision 1.328 diff -u -r1.328 string.c --- ext/standard/string.c 24 Oct 2002 19:11:49 -0000 1.328 +++ ext/standard/string.c 24 Oct 2002 22:22:37 -0000 @@ -990,7 +990,7 @@ e = c+len; while (c < e) { - *c = toupper(*c); + *c = toupper((unsigned char)*c); c++; } return s;
Ilia On October 24, 2002 03:50 pm, Melvyn Sopacua wrote: > At 21:27 24-10-2002, Marcus Börger wrote: > >The test PASSES on my system. So the question is why should it > >be skipped on BSD or if not why does it fail? > > It shouldn't be skipped, that's why I added the locale for FreeBSD. > > The other question I can't answer - all I know is, that 4.2.3 handles it > correctly and 4.3.0 doesn't . > > I can try and trace this through all the commits on string.c, but will > have to wait until the weekend. > > http://cvs.php.net/diff.php/php4/ext/standard/string.c?r1=1.263.2.6&r2=1.32 >8&ty=h > > Then again - it may related to completely different settings :( > > If there are volunteers for the job, with BSD systems - be my guest :) > > >It seems that the skip logic is done well. > > > >marcus > > > >At 21:17 24.10.2002, Melvyn Sopacua wrote: > >>msopacua Thu Oct 24 15:17:09 2002 EDT > >> > >> Modified files: > >> /php4/ext/standard file.c > >> /php4/ext/standard/tests/strings strtoupper.phpt > >> Log: > >> - Add locale string for FreeBSD > >> ATTN: Test nog longer skips, but fails. So whatever has changed since > >> 4.2.3 > >> affects BSD systems. > > > >(...) > > Met vriendelijke groeten / With kind regards, > > Webmaster IDG.nl > Melvyn Sopacua -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php