summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cop.h7
-rw-r--r--deb.c2
-rw-r--r--pp_ctl.c2
-rw-r--r--toke.c6
-rw-r--r--util.c2
5 files changed, 13 insertions, 6 deletions
diff --git a/cop.h b/cop.h
index 3e1820fc20..d617bfc32a 100644
--- a/cop.h
+++ b/cop.h
@@ -70,6 +70,13 @@ struct cop {
#define CopLINE_dec(c) (--CopLINE(c))
#define CopLINE_set(c,l) (CopLINE(c) = (l))
+/* OutCopFILE() is CopFILE for output (caller, die, warn, etc.) */
+#ifdef MACOS_TRADITIONAL
+# define OutCopFILE(c) MacPerl_MPWFileName(CopFILE(c))
+#else
+# define OutCopFILE(c) CopFILE(c)
+#endif
+
/*
* Here we have some enormously heavy (or at least ponderous) wizardry.
*/
diff --git a/deb.c b/deb.c
index 4b964a32a1..fae944cf07 100644
--- a/deb.c
+++ b/deb.c
@@ -45,7 +45,7 @@ void
Perl_vdeb(pTHX_ const char *pat, va_list *args)
{
#ifdef DEBUGGING
- char* file = CopFILE(PL_curcop);
+ char* file = OutCopFILE(PL_curcop);
#ifdef USE_5005THREADS
PerlIO_printf(Perl_debug_log, "0x%"UVxf" (%s:%ld)\t",
diff --git a/pp_ctl.c b/pp_ctl.c
index 183849e121..9dbd52522c 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1414,7 +1414,7 @@ PP(pp_caller)
PUSHs(&PL_sv_undef);
else
PUSHs(sv_2mortal(newSVpv(stashname, 0)));
- PUSHs(sv_2mortal(newSVpv(CopFILE(cx->blk_oldcop), 0)));
+ PUSHs(sv_2mortal(newSVpv(OutCopFILE(cx->blk_oldcop), 0)));
PUSHs(sv_2mortal(newSViv((I32)CopLINE(cx->blk_oldcop))));
if (!MAXARG)
RETURN;
diff --git a/toke.c b/toke.c
index 7db985e5cd..2eb049fac0 100644
--- a/toke.c
+++ b/toke.c
@@ -7594,7 +7594,7 @@ Perl_yyerror(pTHX_ char *s)
}
msg = sv_2mortal(newSVpv(s, 0));
Perl_sv_catpvf(aTHX_ msg, " at %s line %"IVdf", ",
- CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
+ OutCopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
if (context)
Perl_sv_catpvf(aTHX_ msg, "near \"%.*s\"\n", contlen, context);
else
@@ -7612,10 +7612,10 @@ Perl_yyerror(pTHX_ char *s)
if (PL_error_count >= 10) {
if (PL_in_eval && SvCUR(ERRSV))
Perl_croak(aTHX_ "%"SVf"%s has too many errors.\n",
- ERRSV, CopFILE(PL_curcop));
+ ERRSV, OutCopFILE(PL_curcop));
else
Perl_croak(aTHX_ "%s has too many errors.\n",
- CopFILE(PL_curcop));
+ OutCopFILE(PL_curcop));
}
PL_in_my = 0;
PL_in_my_stash = Nullhv;
diff --git a/util.c b/util.c
index fb064afe47..33dcf191bc 100644
--- a/util.c
+++ b/util.c
@@ -1104,7 +1104,7 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
if (CopLINE(cop))
Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf,
- CopFILE(cop), (IV)CopLINE(cop));
+ OutCopFILE(cop), (IV)CopLINE(cop));
if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');