summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-09-23 06:56:40 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 06:56:40 +0000
commit8d300b32a709a689cc4faaa10b28cbb610d1e846 (patch)
tree24646bc1c0064c96a81756f964bc76852a21cbdd /regexec.c
parentf8b5b99cdebd8b6c68cad87fddf11ad38bd6bcf9 (diff)
downloadperl-8d300b32a709a689cc4faaa10b28cbb610d1e846.tar.gz
re-introduce change#1703
p4raw-link: @1703 on //depot/maint-5.005/perl: af819cba4f44bf2074ec4808e403dedf8c3ce2b2 p4raw-id: //depot/perl@1825
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/regexec.c b/regexec.c
index 2dac18d95a..2bbe487955 100644
--- a/regexec.c
+++ b/regexec.c
@@ -386,11 +386,14 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend,
DEBUG_r(
PerlIO_printf(Perl_debug_log,
- "Matching `%.60s%s' against `%.*s%s'\n",
- prog->precomp,
+ "%sMatching%s `%s%.60s%s%s' against `%s%.*s%s%s'\n",
+ PL_colors[4],PL_colors[5],PL_colors[0],
+ prog->precomp,
+ PL_colors[1],
(strlen(prog->precomp) > 60 ? "..." : ""),
+ PL_colors[0],
(strend - startpos > 60 ? 60 : strend - startpos),
- startpos,
+ startpos, PL_colors[1],
(strend - startpos > 60 ? "..." : ""))
);
@@ -1101,15 +1104,21 @@ regmatch(regnode *prog)
int l = (PL_regeol - locinput > taill ? taill : PL_regeol - locinput);
int pref_len = (locinput - PL_bostr > (5 + taill) - l
? (5 + taill) - l : locinput - PL_bostr);
+ int pref0_len = pref_len - (locinput - PL_reginput);
if (l + pref_len < (5 + taill) && l < PL_regeol - locinput)
l = ( PL_regeol - locinput > (5 + taill) - pref_len
? (5 + taill) - pref_len : PL_regeol - locinput);
+ if (pref0_len < 0)
+ pref0_len = 0;
regprop(prop, scan);
PerlIO_printf(Perl_debug_log,
- "%4i <%s%.*s%s%s%s%.*s%s>%*s|%3d:%*s%s\n",
+ "%4i <%s%.*s%s%s%.*s%s%s%s%.*s%s>%*s|%3d:%*s%s\n",
locinput - PL_bostr,
- PL_colors[2], pref_len, locinput - pref_len, PL_colors[3],
+ PL_colors[4], pref0_len,
+ locinput - pref_len, PL_colors[5],
+ PL_colors[2], pref_len - pref0_len,
+ locinput - pref_len + pref0_len, PL_colors[3],
(docolor ? "" : "> <"),
PL_colors[0], l, locinput, PL_colors[1],
15 - l - pref_len + 1,