X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FCwd%2FCwd.xs;h=f53f6ee19e408064a24338c133d2c11cc006dd0c;hb=91f3b821ca3eaa8b7d74bb338729ba51b7b68a90;hp=a82404f15654bdeb976eb92b81ad59d9901dd902;hpb=ea7154893ee587d7e47bcebff9e70757b48a38bd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Cwd/Cwd.xs b/ext/Cwd/Cwd.xs index a82404f..f53f6ee 100644 --- a/ext/Cwd/Cwd.xs +++ b/ext/Cwd/Cwd.xs @@ -70,10 +70,10 @@ bsd_realpath(path, resolved) char *resolved; { #ifdef VMS - return Perl_rmsexpand((char*)path, resolved, NULL, 0); + dTHX; + return Perl_rmsexpand(aTHX_ (char*)path, resolved, NULL, 0); #else - struct stat sb; - int n, rootd, serrno; + int rootd, serrno; char *p, *q, wbuf[MAXPATHLEN]; int symlinks = 0; @@ -123,9 +123,12 @@ loop: p = resolved; #if defined(HAS_LSTAT) && defined(HAS_READLINK) && defined(HAS_SYMLINK) + { + struct stat sb; /* Deal with the last component. */ if (lstat(p, &sb) == 0) { if (S_ISLNK(sb.st_mode)) { + int n; if (++symlinks > MAXSYMLINKS) { errno = ELOOP; goto err1; @@ -142,6 +145,7 @@ loop: p = ""; } } + } #endif /* @@ -212,6 +216,7 @@ PROTOTYPES: ENABLE void fastcwd() +PROTOTYPE: DISABLE PPCODE: { dXSTARG;