Skip to content

Commit

Permalink
perl5db.pl: Fix regex in cmd_a allowing short actions
Browse files Browse the repository at this point in the history
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 <zhmylove@narod.ru>
  • Loading branch information
zhmylove committed Jan 15, 2025
1 parent 7a1c156 commit 0071cad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ Scott Wiersdorf <scott@perlcode.org> scott@perlcode.org <scott@perlcode.org>
Sean Davis <dive@endersgame.net> Sean Davis <dive@ender.com>
Sebastian Schmidt <yath@yath.de> <yath@yath.de>
Sebastian Schmidt <yath@yath.de> yath-perlbug@yath.de <yath-perlbug@yath.de>
Sergey Zhmylove <zhmylove@narod.ru> Sergei Zhmylev <zhmylove@narod.ru>
Sergey Zhmylove <zhmylove@narod.ru> zhmylove <zhmylove@narod.ru>
Shawn M Moore <sartak@gmail.com> Shawn M Moore <code@sartak.org>
Shawn M Moore <sartak@gmail.com> Shawn M Moore <sartak@bestpractical.com>
Expand Down
4 changes: 2 additions & 2 deletions lib/perl5db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0071cad

Please sign in to comment.