Prevent space between command and comment from being included in the command

This commit is contained in:
Jamie Cameron
2015-12-22 10:25:49 -08:00
parent 2a6fe1a536
commit fcadcdee09

View File

@@ -1471,7 +1471,7 @@ Given a cron job with a # comment after the command, sets the comment field
sub convert_comment
{
local ($job) = @_;
if ($job->{'command'} =~ /^(.*)\s*#([^#]*)$/) {
if ($job->{'command'} =~ /^(.*\S)\s*#([^#]*)$/) {
$job->{'command'} = $1;
$job->{'comment'} = $2;
return 1;