This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Make variable in get_startup_shell non-static
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 14 Sep 2018 12:49:37 -0000
- Subject: [binutils-gdb] Make variable in get_startup_shell non-static
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=87b240d48512fa30aab8b5963914a9093009fd68
commit 87b240d48512fa30aab8b5963914a9093009fd68
Author: Tom Tromey <tom@tromey.com>
Date: Thu Sep 13 16:33:27 2018 -0600
Make variable in get_startup_shell non-static
I noticed that a variable in get_startup_shell is "static". However,
I couldn't see any reason it ought to be, so this removes the
"static".
gdb/ChangeLog
2018-09-14 Tom Tromey <tom@tromey.com>
* nat/fork-inferior.c (get_startup_shell): Remove "static".
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/nat/fork-inferior.c | 4 +---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 931842b..d83f087 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2018-09-14 Tom Tromey <tom@tromey.com>
+
+ * nat/fork-inferior.c (get_startup_shell): Remove "static".
+
2018-09-13 Tom Tromey <tom@tromey.com>
* python/py-inferior.c (infpy_thread_from_thread_handle): Now
diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
index ea71aad..40cd05a 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -272,9 +272,7 @@ execv_argv::init_for_shell (const char *exec_file,
static const char *
get_startup_shell ()
{
- static const char *ret;
-
- ret = getenv ("SHELL");
+ const char *ret = getenv ("SHELL");
if (ret == NULL)
ret = SHELL_FILE;