This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow debugger aliases that start with '-' and '.'
authorjkahrman <jkahrman@users.noreply.github.com>
Thu, 16 Apr 2020 06:00:04 +0000 (02:00 -0400)
committerTony Cook <tony@develop-help.com>
Tue, 8 Dec 2020 22:20:36 +0000 (09:20 +1100)
Since the '.' and '-' commands don't take any arguments and don't run if any are provided, don't treat commands starting with these characters as the single commands '.' and '-'. Restores behavior that existed prior to https://github.com/Perl/perl5/commit/7fdd4f080863703d44282c6988834455d129040 (v5.27) at least back to v5.8.8

https://github.com/Perl/perl5/commit/7fdd4f080863703d44282c6988834455d129040

lib/perl5db.pl

index 69890ef..365649e 100644 (file)
@@ -1878,7 +1878,7 @@ sub _DB__trim_command_and_return_first_component {
     # A single-character debugger command can be immediately followed by its
     # argument if they aren't both alphanumeric; otherwise require space
     # between commands and arguments:
     # A single-character debugger command can be immediately followed by its
     # argument if they aren't both alphanumeric; otherwise require space
     # between commands and arguments:
-    my ($verb, $args) = $cmd =~ m{\A(.\b|\S*)\s*(.*)}s;
+    my ($verb, $args) = $cmd =~ m{\A([^\.-]\b|\S*)\s*(.*)}s;
 
     $obj->cmd_verb($verb);
     $obj->cmd_args($args);
 
     $obj->cmd_verb($verb);
     $obj->cmd_args($args);