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.
+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.
+
2018-09-23 Tom Tromey <tom@tromey.com>
PR python/18852:
#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. */
}
#endif
- char *home = getenv ("HOME");
+ const char *home = getenv ("HOME");
if (home != NULL)
{
/* Make sure the path is absolute and tilde-expanded. */
if (!initialized)
{
struct stat homebuf, cwdbuf, s;
- char *homedir;
+ const char *homedir;
if (SYSTEM_GDBINIT[0])
{
void
init_history (void)
{
- char *tmpenv;
+ const char *tmpenv;
tmpenv = getenv ("GDBHISTSIZE");
if (tmpenv)