groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 05/24: [grog]: Fix Savannah #66429.


From: G. Branden Robinson
Subject: [groff] 05/24: [grog]: Fix Savannah #66429.
Date: Sun, 10 Nov 2024 14:56:19 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit b840ecef992d152d201962891a69f28e5de10048
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 8 09:25:58 2024 -0600

    [grog]: Fix Savannah #66429.
    
    * src/utils/grog/grog.pl (construct_command): Check for truthiness of
      `main_package` scalar before using it in comparison, avoiding the
      emission of Perl warnings.
    
    Fixes <https://savannah.gnu.org/bugs/?66429>.  Problem introduced by me
    prior to groff 1.23.0 when I rewrote the tool.
---
 ChangeLog              | 9 +++++++++
 src/utils/grog/grog.pl | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f5ba5759a..6f98b842c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-11-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/utils/grog/grog.pl (construct_command): Check for
+       truthiness of `main_package` scalar before using it in
+       comparison, avoiding the emission of Perl warnings.
+
+       Fixes <https://savannah.gnu.org/bugs/?66429>.  Problem
+       introduced by me prior to groff 1.23.0 when I rewrote the tool.
+
 2024-11-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [grops]: Further revise fix for Savannah #61424.  Instead of
diff --git a/src/utils/grog/grog.pl b/src/utils/grog/grog.pl
index c0d9d555d..1b4aac64a 100644
--- a/src/utils/grog/grog.pl
+++ b/src/utils/grog/grog.pl
@@ -638,11 +638,11 @@ sub construct_command {
     my $is_auxiliary_package = 1;
     if (grep(/$pkg/, @main_package)) {
       $is_auxiliary_package = 0;
-      if ($pkg ne $main_package) {
+      if ($main_package && ($pkg ne $main_package)) {
        &warn("overriding inferred package '$main_package'"
              . " with requested package '$pkg'");
-       $main_package = $pkg;
       }
+      $main_package = $pkg;
     }
     if ($is_auxiliary_package) {
       push @auxiliary_package_argument, "-m" . $pkg;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]