aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/pathstuff.c12
-rw-r--r--gdb/common/pathstuff.h5
2 files changed, 17 insertions, 0 deletions
diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c
index 82905c9e..6d8e53f 100644
--- a/gdb/common/pathstuff.c
+++ b/gdb/common/pathstuff.c
@@ -190,3 +190,15 @@ get_standard_cache_dir ()
return {};
}
+
+/* See common/pathstuff.h. */
+
+const char *
+get_shell ()
+{
+ const char *ret = getenv ("SHELL");
+ if (ret == NULL)
+ ret = "/bin/sh";
+
+ return ret;
+}
diff --git a/gdb/common/pathstuff.h b/gdb/common/pathstuff.h
index a43b963..0a8caea 100644
--- a/gdb/common/pathstuff.h
+++ b/gdb/common/pathstuff.h
@@ -64,4 +64,9 @@ extern bool contains_dir_separator (const char *path);
extern std::string get_standard_cache_dir ();
+/* Return the file name of the user's shell. Normally this comes from
+ the SHELL environment variable. */
+
+extern const char *get_shell ();
+
#endif /* PATHSTUFF_H */