summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Gustin <cedric.gustin@swing.be>2005-06-07 06:32:45 +0000
committerCedric Gustin <gustin@src.gnome.org>2005-06-07 06:32:45 +0000
commita946ac668bdfca52ec3fe12cccfa2c0dab80793c (patch)
tree7f1f16c28b1190067afb6e58a8b1cadc74883e12
parent0b2cdd35ebaecd318c32268b31ef56c6d0185353 (diff)
downloadglibmm-a946ac668bdfca52ec3fe12cccfa2c0dab80793c.tar.gz
In get_home_dir, return an empty string when HOME is not defined (Win9x).
2005-06-07 Cedric Gustin <cedric.gustin@swing.be> * glib/glibmm/miscutils.cc: In get_home_dir, return an empty string when HOME is not defined (Win9x). Bug #306310 from Michael Hofmann. * glib/glibmm/miscutils.h: Updated docstring for the get_home_dir method.
-rw-r--r--ChangeLog8
-rw-r--r--glib/glibmm/miscutils.cc3
-rw-r--r--glib/glibmm/miscutils.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 49974260..d6e15406 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-06-07 Cedric Gustin <cedric.gustin@swing.be>
+
+ * glib/glibmm/miscutils.cc: In get_home_dir, return an empty
+ string when HOME is not defined (Win9x). Bug #306310 from Michael
+ Hofmann.
+ * glib/glibmm/miscutils.h: Updated docstring for the get_home_dir
+ method.
+
2005-04-27 Murray Cumming <murrayc@murrayc.com>
* examples/child_watch/main.cc:
diff --git a/glib/glibmm/miscutils.cc b/glib/glibmm/miscutils.cc
index b25318fc..752e5c84 100644
--- a/glib/glibmm/miscutils.cc
+++ b/glib/glibmm/miscutils.cc
@@ -100,7 +100,8 @@ std::string get_real_name()
std::string get_home_dir()
{
- return std::string(g_get_home_dir());
+ const char *const value = g_get_home_dir();
+ return (value) ? std::string(value) : std::string();
}
std::string get_tmp_dir()
diff --git a/glib/glibmm/miscutils.h b/glib/glibmm/miscutils.h
index 8087add3..651d1b2f 100644
--- a/glib/glibmm/miscutils.h
+++ b/glib/glibmm/miscutils.h
@@ -137,7 +137,7 @@ std::string get_user_name();
std::string get_real_name();
/** Gets the current user's home directory.
- * @return The current user's home directory.
+ * @return The current user's home directory or an empty string if not defined.
*/
std::string get_home_dir();