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 <[email protected]>
  • Loading branch information
zhmylove committed Jan 15, 2025
1 parent 7a1c156 commit d4e957d
Showing 1 changed file with 2 additions and 2 deletions.
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 d4e957d

Please sign in to comment.