aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-09-24 06:15:17 -0600
committerTom Tromey <tom@tromey.com>2018-09-24 06:17:13 -0600
commitb5a9bfbebec0a42d3c5b4fe3b7a62bd31cecc440 (patch)
tree63d9c45a45305b6d006c9f7bb2bec63be62deb2b /gdb/common
parentae778caf097e08497f2e9218cf68b254b8da38f1 (diff)
downloadbinutils-b5a9bfbebec0a42d3c5b4fe3b7a62bd31cecc440.zip
binutils-b5a9bfbebec0a42d3c5b4fe3b7a62bd31cecc440.tar.gz
binutils-b5a9bfbebec0a42d3c5b4fe3b7a62bd31cecc440.tar.bz2
Add "const" to a few locals in gdb
I noticed that some code in gdb was doing: char *mumble = getenv (...) However, using "const char *" here would be clearer. This patch fixes the instances I could readily build. Tested by rebuilding. gdb/ChangeLog 2018-09-24 Tom Tromey <tom@tromey.com> * common/pathstuff.c (get_standard_cache_dir): Make "xdg_cache_home" and "home" const. * top.c (init_history): Make "tmpenv" const. * main.c (get_init_files): Make "homedir" const.
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/pathstuff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c
index 3dd58e3..82905c9e 100644
--- a/gdb/common/pathstuff.c
+++ b/gdb/common/pathstuff.c
@@ -171,7 +171,7 @@ get_standard_cache_dir ()
#endif
#ifndef __APPLE__
- char *xdg_cache_home = getenv ("XDG_CACHE_HOME");
+ const char *xdg_cache_home = getenv ("XDG_CACHE_HOME");
if (xdg_cache_home != NULL)
{
/* Make sure the path is absolute and tilde-expanded. */
@@ -180,7 +180,7 @@ get_standard_cache_dir ()
}
#endif
- char *home = getenv ("HOME");
+ const char *home = getenv ("HOME");
if (home != NULL)
{
/* Make sure the path is absolute and tilde-expanded. */