1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
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,,
|