From: Craig A. Berry Date: Tue, 12 Jun 2001 22:21:39 +0000 (-0500) Subject: Re: hacking util.c, attrs.xs, and re.xs to compile on VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a5ff3b9ad25c72d5b32019260730131002679dcd;p=p5sagit%2Fp5-mst-13.2.git Re: hacking util.c, attrs.xs, and re.xs to compile on VMS Message-Id: p4raw-id: //depot/perl@10555 --- diff --git a/configure.com b/configure.com index 4a5ee1e..7b02485 100644 --- a/configure.com +++ b/configure.com @@ -3654,7 +3654,7 @@ $ WS "#include " $ WS "int main()" $ WS "{" $ WS "char * place;" -$ WS "place = memchr(""foo"", 47, 3)" +$ WS "place = memchr(""foo"", 47, 3);" $ WS "exit(0);" $ WS "}" $ CS diff --git a/util.c b/util.c index 91bbc0b..945172e 100644 --- a/util.c +++ b/util.c @@ -4940,10 +4940,9 @@ Perl_sv_realpath(pTHX_ SV *sv, char *path, STRLEN len) #ifndef PERL_MICRO char name[MAXPATHLEN] = { 0 }, *s; STRLEN pathlen, namelen; - const char zero = '\0'; /* Don't use strlen() to avoid running off the end. */ - s = memchr(path, zero, MAXPATHLEN); + s = memchr(path, '\0', MAXPATHLEN); pathlen = s ? s - path : MAXPATHLEN; #ifdef HAS_REALPATH @@ -4967,7 +4966,7 @@ Perl_sv_realpath(pTHX_ SV *sv, char *path, STRLEN len) /* Is the destination buffer too long? * Don't use strlen() to avoid running off the end. */ - s = memchr(name, zero, MAXPATHLEN); + s = memchr(name, '\0', MAXPATHLEN); namelen = s ? s - name : MAXPATHLEN; if (namelen == MAXPATHLEN) { Perl_warn(aTHX_ "sv_realpath: realpath(\"%s\"): %c= (MAXPATHLEN = %d)",