From a946ac668bdfca52ec3fe12cccfa2c0dab80793c Mon Sep 17 00:00:00 2001 From: Cedric Gustin Date: Tue, 7 Jun 2005 06:32:45 +0000 Subject: In get_home_dir, return an empty string when HOME is not defined (Win9x). 2005-06-07 Cedric Gustin * 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. --- ChangeLog | 8 ++++++++ glib/glibmm/miscutils.cc | 3 ++- glib/glibmm/miscutils.h | 2 +- 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 + + * 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 * 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(); -- cgit v1.2.1