diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-05 17:13:48 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-05 17:13:48 +0000 |
commit | 7785d218894ec033856d95749a4e3d546eb61f33 (patch) | |
tree | db60a79a29a7bf4f3ab6aba8f7a2486e05856578 /perl.c | |
parent | 39bac7f7f5a36515e5edfd18fa0ae05b4fb933ec (diff) | |
download | perl-7785d218894ec033856d95749a4e3d546eb61f33.tar.gz |
strip last component of SITELIB_EXP only if it looks like a
number
p4raw-id: //depot/perl@5545
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -3257,10 +3257,15 @@ S_init_perllib(pTHX) if (path) { char buf[1024]; - strcpy(buf,path); - if (strrchr(buf,'/')) /* XXX Hack, Configure var needed */ - *strrchr(buf,'/') = '\0'; - incpush(buf, TRUE); + char *ver = strrchr(path,'/'); /* XXX Hack, Configure var needed */ + if (ver && ver[1] == (STRINGIFY(PERL_REVISION))[0] + && strlen(path) < sizeof(buf)) + { + strcpy(buf,path); + buf[ver-path] = '\0'; + path = buf; + } + incpush(path, TRUE); } } #endif |