Skip to content
Permalink
Browse files

Revert "[JVM] Avoid StringIndexOutOfBoundsException"

This reverts commit 07b4f74.

This fix is not needed since 0effc37. That other commit
made sure $execname is always an absolute path. With an absolute
path the path manipulation logic here works without modification.
  • Loading branch information...
patzim committed Apr 27, 2019
1 parent de42e71 commit cac95fbbcce41633a132942549e1bf0ef8b3cd84
Showing with 2 additions and 4 deletions.
  1. +1 −2 src/main.nqp
  2. +1 −2 src/perl6-debug.nqp
@@ -23,9 +23,8 @@ my $config := nqp::backendconfig();
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
#?if jvm
my $execname := nqp::atkey(nqp::jvmgetproperties,'perl6.execname');
my $rindex-pos := nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1);
my $install-dir := $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, $rindex-pos < 0 ?? nqp::chars($execname) !! $rindex-pos))
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif
#?if moar
@@ -471,9 +471,8 @@ sub MAIN(*@ARGS) {
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
#?if jvm
my $execname := nqp::atkey(nqp::jvmgetproperties,'perl6.execname');
my $rindex-pos := nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1);
my $install-dir := $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, $rindex-pos < 0 ?? nqp::chars($execname) !! $rindex-pos))
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif
#?if moar

0 comments on commit cac95fb

Please sign in to comment.
You can’t perform that action at this time.