From: Mats Erik Andersson <debian@gisladisker.se>
Date: Mon, 6 Jun 2022 11:29:01 +0800
Subject: Duplicate use of symbol 'base_name'.

Some source files in the directory 'src/' are using a string variable
'base_name'.  At the same time the directory 'gnu/' uses the very same
identifier as a function.  It is expected that the linker will cause
some indeterminism in choosing which of these references to prefer at
linking time.  To avoid this randomness, the string variable is renamed.

Observe that 'src/rlopt.h' and 'src/rwopt.h' are generated by upstream's
release process from 'src/rlopt.opt' and 'src/rwopt.opt', respectively.
All of them are patched for better consistency.
---
 src/rlopt.h    | 2 +-
 src/rlopt.opt  | 2 +-
 src/rushlast.c | 6 +++---
 src/rushwho.c  | 6 +++---
 src/rwopt.h    | 2 +-
 src/rwopt.opt  | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/rlopt.h b/src/rlopt.h
index 31c90cf..e4244e3 100644
--- a/src/rlopt.h
+++ b/src/rlopt.h
@@ -909,7 +909,7 @@ get_options(int argc, char *argv[])
 #line 33
 
 	numeric_option = 0;
-	base_name = optarg;
+	base_name_ = optarg;
 
 #line 36
              break;
diff --git a/src/rlopt.opt b/src/rlopt.opt
index 4910e20..0938d30 100644
--- a/src/rlopt.opt
+++ b/src/rlopt.opt
@@ -32,7 +32,7 @@ OPTION(file,f,DIR,
        [<Look for database files in DIR.>])
 BEGIN
 	OPTSETUP;
-	base_name = optarg;
+	base_name_ = optarg;
 END
 
 OPTION(forward,,,
diff --git a/src/rushlast.c b/src/rushlast.c
index da62e39..4caafb5 100644
--- a/src/rushlast.c
+++ b/src/rushlast.c
@@ -17,7 +17,7 @@
 #include <rush.h>
 #include "error.h"
 
-char *base_name = RUSH_DB;
+char *base_name_ = RUSH_DB;
 int  display_header = 1;  /* Display header line */
 int forward = 0;
 char *format;
@@ -77,7 +77,7 @@ main(int argc, char **argv)
         if (!form) 
                 error(1, 0, _("invalid format: %s"), rushdb_error_string);
         
-        switch (rushdb_open(base_name, 0)) {
+        switch (rushdb_open(base_name_, 0)) {
         case rushdb_result_ok:
                 break;
 
@@ -85,7 +85,7 @@ main(int argc, char **argv)
                 exit(0);
 
         case rushdb_result_fail:
-                error(1, errno, _("cannot open database file %s"), base_name);
+                error(1, errno, _("cannot open database file %s"), base_name_);
         }
 
         if (display_header)
diff --git a/src/rushwho.c b/src/rushwho.c
index 04e8520..6061326 100644
--- a/src/rushwho.c
+++ b/src/rushwho.c
@@ -17,7 +17,7 @@
 #include <rush.h>
 #include "error.h"
 
-char *base_name = RUSH_DB;
+char *base_name_ = RUSH_DB;
 struct rush_wtmp *wtmp = NULL;
 int  display_header = 1;  /* Display header line */
 char *format;
@@ -66,7 +66,7 @@ main(int argc, char **argv)
 	if (!form) 
 		error(1, 0, _("invalid format: %s"), rushdb_error_string);
 
-	switch (rushdb_open(base_name, 0)) {
+	switch (rushdb_open(base_name_, 0)) {
 	case rushdb_result_ok:
 		break;
 
@@ -74,7 +74,7 @@ main(int argc, char **argv)
 		exit(0);
 
 	case rushdb_result_fail:
-                error(1, errno, _("cannot open database file %s"), base_name);
+                error(1, errno, _("cannot open database file %s"), base_name_);
 	}
 
 	if (display_header)
diff --git a/src/rwopt.h b/src/rwopt.h
index 1cfcd9b..cabcbcf 100644
--- a/src/rwopt.h
+++ b/src/rwopt.h
@@ -884,7 +884,7 @@ get_options(int argc, char *argv[])
           {
 #line 28
 
-	base_name = optarg;
+	base_name_ = optarg;
 
 #line 30
              break;
diff --git a/src/rwopt.opt b/src/rwopt.opt
index c7c2747..4708f28 100644
--- a/src/rwopt.opt
+++ b/src/rwopt.opt
@@ -26,7 +26,7 @@ END
 OPTION(file,f,DIR,
        [<Look for database files in DIR.>])
 BEGIN
-	base_name = optarg;
+	base_name_ = optarg;
 END
 
 OPTION(no-header,H,,
