summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorMatthew Horsfall (alh) <wolfsage@gmail.com>2012-12-27 10:38:08 -0500
committerFather Chrysostomos <sprout@cpan.org>2013-02-10 12:19:15 -0800
commit6b0bdd7f2041803dc3ec72b53d28052705861967 (patch)
tree23dd247e976e9a1674ff16c177fb44c53db6088d /pp_ctl.c
parent8e8f9da447f19cb13656a3f73b304a970acee98b (diff)
downloadperl-6b0bdd7f2041803dc3ec72b53d28052705861967.tar.gz
RT-116192 - If a directory in @INC already has a trailing '/', don't add another.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index d5028c8980..616c7c1975 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3889,7 +3889,12 @@ PP(pp_require)
memcpy(tmp, dir, dirlen);
tmp +=dirlen;
- *tmp++ = '/';
+
+ /* Avoid '<dir>//<file>' */
+ if (!dirlen || *(tmp-1) != '/') {
+ *tmp++ = '/';
+ }
+
/* name came from an SV, so it will have a '\0' at the
end that we can copy as part of this memcpy(). */
memcpy(tmp, name, len + 1);