Could you please try the attached patch and let me know if it fixes the 
problem.

Ilia

On October 24, 2002 06:27 pm, Melvyn Sopacua wrote:
> 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
Index: ext/standard/string.c
===================================================================
RCS file: /repository/php4/ext/standard/string.c,v
retrieving revision 1.327
diff -u -3 -p -r1.327 string.c
--- ext/standard/string.c       22 Oct 2002 18:27:56 -0000      1.327
+++ ext/standard/string.c       24 Oct 2002 23:29:28 -0000
@@ -983,7 +983,7 @@ restore:
  */
 PHPAPI char *php_strtoupper(char *s, size_t len)
 {
-       char *c, *e;
+       unsigned char *c, *e;
        
        c = s;
        e = c+len;
@@ -1017,7 +1017,7 @@ PHP_FUNCTION(strtoupper)
  */
 PHPAPI char *php_strtolower(char *s, size_t len)
 {
-       char *c, *e;
+       unsigned char *c, *e;
        
        c = s;
        e = c+len;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to