From b5a9bfbebec0a42d3c5b4fe3b7a62bd31cecc440 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 24 Sep 2018 06:15:17 -0600 Subject: 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 * 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. --- gdb/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/top.c') diff --git a/gdb/top.c b/gdb/top.c index 0a4d36c..4a0fedb 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1846,7 +1846,7 @@ set_verbose (const char *args, int from_tty, struct cmd_list_element *c) void init_history (void) { - char *tmpenv; + const char *tmpenv; tmpenv = getenv ("GDBHISTSIZE"); if (tmpenv) -- cgit v1.1