summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/doio.c b/doio.c
index 53863b649d..3ed517b0bd 100644
--- a/doio.c
+++ b/doio.c
@@ -1294,15 +1294,18 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
*a++ = "";
}
*a = Nullch;
- if (*PL_Argv[0] != '/') /* will execvp use PATH? */
+ if (really)
+ tmps = SvPV(really, n_a);
+ if ((!really && *PL_Argv[0] != '/') ||
+ (really && *tmps != '/')) /* will execvp use PATH? */
TAINT_ENV(); /* testing IFS here is overkill, probably */
- if (really && *(tmps = SvPV(really, n_a)))
+ if (really && *tmps)
PerlProc_execvp(tmps,EXEC_ARGV_CAST(PL_Argv));
else
PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv));
if (ckWARN(WARN_EXEC))
Perl_warner(aTHX_ WARN_EXEC, "Can't exec \"%s\": %s",
- PL_Argv[0], Strerror(errno));
+ (really ? tmps : PL_Argv[0]), Strerror(errno));
if (do_report) {
int e = errno;