summaryrefslogtreecommitdiff
path: root/help2man.PL
diff options
context:
space:
mode:
authorBrendan O'Dea <bod@debian.org>2020-03-15 22:06:42 +1100
committerBrendan O'Dea <bod@debian.org>2020-03-15 22:06:42 +1100
commit611b98db2ec993fab6fd957fca62beee3b803520 (patch)
tree6b84c0c63836b16be4d55a3c4f763bae51ca4639 /help2man.PL
parentf284bd0d3bcb2893b0e8f5575140f8b0655fe16c (diff)
downloadhelp2man-611b98db2ec993fab6fd957fca62beee3b803520.tar.gz
Update parsing of --version to allow multi-word programs
Diffstat (limited to 'help2man.PL')
-rwxr-xr-xhelp2man.PL6
1 files changed, 3 insertions, 3 deletions
diff --git a/help2man.PL b/help2man.PL
index 2fee2bf..ba0864c 100755
--- a/help2man.PL
+++ b/help2man.PL
@@ -409,14 +409,14 @@ if ($opt_output)
($_, $version_text) = ((split /\n+/, $version_text, 2), '');
-if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or
- /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
+if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(\S+)$/ or
+ /^(\S+) +- *((?:GNU|Free) +\S.*) +(\S+)$/)
{
$program = program_basename $1;
$package = $2;
$version = $3;
}
-elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/)
+elsif (/^((?:GNU|Free) +)?(\S.*) +(\S+)$/)
{
$program = program_basename $2;
$package = $1 ? "$1$program" : $program;