On Wed, Dec 31, 2003 at 09:19:25AM +0100, Rafael Garcia-Suarez wrote:
> Selon Jarkko Hietaniemi <[EMAIL PROTECTED]>:

> > 213 #ifndef getcwd_sv
> > 214 // Taken from perl 5.8's util.c
> > 215 int getcwd_sv(pTHX_ register SV *sv)
> > 
> > The // doesn't fly because of the -ansi (used to work fine with  
> > Tru64/Digital UNIX/DEC OSF/1 gcc) which is trivially fixable by making  
> > the C++ comment to be a C comment.  After fixing that all builds well  
> > with gcc (5.8.x).

Ken you bad bad man.

The good news is that on FreeBSD, I can also use -ansi :-)

ccache gcc -c    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -ansi -fno-strict-aliasing 
-I/usr/local/include -O2    -DVERSION=\"2.12\"  -DXS_VERSION=\"2.12\" -DPIC -fPIC 
"-I../.."   Cwd.c
Cwd.xs:214: unterminated string or character constant

> Fixed as change #22020 in bleadperl. CC:'ing Ken for reintegration
> in the CPAN version.

Also, we goofed - we didn't update the file that says which modules are
dual life, and this patch was applied to Cwd.xs before 5.8.2, to fix a
specific buffer overrun that the BSD people announced, which Jarkko spotted
It's not in the CPAN version.

Nicholas Clark

--- ../Cwd-2.08/Cwd.xs  2003-09-28 04:18:02.000000000 +0100
+++ ext/Cwd/Cwd.xs      2003-11-03 21:22:51.000000000 +0000
@@ -166,7 +166,7 @@ loop:
                rootd = 0;
 
        if (*wbuf) {
-               if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+               if (strlen(resolved) + strlen(wbuf) + (1 - rootd) + 1 > MAXPATHLEN) {
                        errno = ENAMETOOLONG;
                        goto err1;
                }

Reply via email to