groff-commit
[Top][All Lists]
Advanced

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

[groff] 25/72: [gropdf]: Stop manipulating program name ($0).


From: G. Branden Robinson
Subject: [groff] 25/72: [gropdf]: Stop manipulating program name ($0).
Date: Sun, 23 Oct 2022 22:25:37 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 5392e729f8c2ce2299abb67855d203d5d3ee1f61
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 21 19:08:04 2022 -0500

    [gropdf]: Stop manipulating program name ($0).
    
    * src/devices/gropdf/gropdf.pl: Revise handling of argument 0.  Rename
      scalar `progname` to `prog` for brevity (and preparation for writing a
      usage message).  Also stop stripping off directory name components
      from it.  No other groff program does this, and it might save users
      some confusion if they're working with multiple copies of gropdf.
---
 ChangeLog                    | 9 +++++++++
 src/devices/gropdf/gropdf.pl | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ea94c008e..f24ee7e5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-10-21  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/devices/gropdf/gropdf.pl: Revise handling of argument 0.
+       Rename scalar `progname` to `prog` for brevity (and preparation
+       for writing a usage message).  Also stop stripping off directory
+       name components from it.  No other groff program does this, and
+       it might save users some confusion if they're working with
+       multiple copies of gropdf.
+
 2022-10-21  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Migrate terminology from "paper size" to "paper format" or
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 37f6e5644..fbf13b178 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -32,7 +32,7 @@ use constant
     USED                => 4,
 };
 
-(my $progname=$0) =~s @.*/@@;
+my $prog=$0;
 
 my $gotzlib=0;
 
@@ -2220,7 +2220,7 @@ sub Msg
 {
     my ($fatal,$msg)=@_;
 
-    print STDERR "$progname:";
+    print STDERR "$prog:";
     print STDERR "$env{SourceFile}: " if exists($env{SourceFile});
 
     if ($fatal)



reply via email to

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