diff options
author | Matthew Horsfall (alh) <wolfsage@gmail.com> | 2012-12-27 10:38:08 -0500 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-02-10 12:19:15 -0800 |
commit | 6b0bdd7f2041803dc3ec72b53d28052705861967 (patch) | |
tree | 23dd247e976e9a1674ff16c177fb44c53db6088d /pp_ctl.c | |
parent | 8e8f9da447f19cb13656a3f73b304a970acee98b (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |