From 0071cad6e2570739c98567284915d5862d87f2b9 Mon Sep 17 00:00:00 2001 From: Sergei Zhmylev Date: Wed, 15 Jan 2025 12:01:24 +0300 Subject: [PATCH] perl5db.pl: Fix regex in cmd_a allowing short actions The regex pattern in the `a` command was updated from `(\S.+)` to `(\S.*)` to correctly handle short actions, including single-character expressions after the line number. Signed-off-by: Sergei Zhmylev --- .mailmap | 1 + lib/perl5db.pl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index d68867f6066c..7cf3500491b4 100644 --- a/.mailmap +++ b/.mailmap @@ -785,6 +785,7 @@ Scott Wiersdorf scott@perlcode.org Sean Davis Sean Davis Sebastian Schmidt Sebastian Schmidt yath-perlbug@yath.de +Sergey Zhmylove Sergei Zhmylev Sergey Zhmylove zhmylove Shawn M Moore Shawn M Moore Shawn M Moore Shawn M Moore diff --git a/lib/perl5db.pl b/lib/perl5db.pl index fbb909449ff7..cc4946e90261 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -4798,7 +4798,7 @@ sub cmd_a { $line =~ s/\A\./$dbline/; # Should be a line number followed by an expression. - if ( my ($lineno, $expr) = $line =~ /^\s*(\d*)\s*(\S.+)/ ) { + if ( my ($lineno, $expr) = $line =~ /^\s*(\d*)\s*(\S.*)/ ) { if (! length($lineno)) { $lineno = $dbline; @@ -4826,7 +4826,7 @@ sub cmd_a { _set_breakpoint_enabled_status($filename, $lineno, 1); } } ## end if (length $expr) - } ## end if ($line =~ /^\s*(\d*)\s*(\S.+)/) + } ## end if ($line =~ /^\s*(\d*)\s*(\S.*)/) else { # Syntax wrong.