summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>2007-12-22 00:52:54 +0000
committerSteve Peters <steve@fisharerojo.org>2007-12-22 19:39:36 +0000
commitf57255841c18e91c7a719a2400645e39398f3947 (patch)
treef65694caf70de021ac2b59e9d7dad9557fa38ba2
parent8f85282b4f585b3837be7544d1ef8bcac73c7b18 (diff)
downloadperl-f57255841c18e91c7a719a2400645e39398f3947.tar.gz
The ext/Cwd/Cwd.xs part of...
Subject: consting Cwd and ExtUtils::ParseXS From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D0939A0@exchsvr2.npl.ad.local> lib/ExtUtils/ParseXS.pm had changes already made with change #32691. p4raw-id: //depot/perl@32710
-rw-r--r--ext/Cwd/Cwd.xs10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/Cwd/Cwd.xs b/ext/Cwd/Cwd.xs
index 7434dfa700..4958bd2bba 100644
--- a/ext/Cwd/Cwd.xs
+++ b/ext/Cwd/Cwd.xs
@@ -79,7 +79,8 @@ bsd_realpath(const char *path, char *resolved)
return Perl_rmsexpand(aTHX_ (char*)path, resolved, NULL, 0);
#else
int rootd, serrno;
- char *p, *q, wbuf[MAXPATHLEN];
+ const char *p;
+ char *q, wbuf[MAXPATHLEN];
int symlinks = 0;
/* Save the starting point. */
@@ -112,17 +113,18 @@ bsd_realpath(const char *path, char *resolved)
loop:
q = strrchr(resolved, '/');
if (q != NULL) {
+ const char *dir;
p = q + 1;
if (q == resolved)
- q = "/";
+ dir = "/";
else {
do {
--q;
} while (q > resolved && *q == '/');
q[1] = '\0';
- q = resolved;
+ dir = resolved;
}
- if (chdir(q) < 0)
+ if (chdir(dir) < 0)
goto err1;
} else
p = resolved;