win32: g_get_home_dir gives different directory in msys vs. non-msys
stimming at tuhh.de
Mon Feb 12 08:17:06 EST 2007
-----BEGIN PGP SIGNED MESSAGE-----
FYI: The function of glib to get the user's home directory
g_get_home_dir() gives sometimes unexpected results. As I've written in
some header file:
On Windows, g_get_home_dir() looks up the environment variable "HOME",
then "USERPROFILE", then the Windows system directory. Watch out: In the
normal non-mingw/msys environment, "HOME" is not set and instead only
"USERPROFILE" is set, e.g. to "c:\Documents\Yourusername". But if this
function is called from within msys, then msys itself has set "HOME" to
a different value, e.g. to "c:\msys\1.0\home\yourusername". In effect,
your program will see a different home directory when run from within
the msys command prompt compared to without msys.
Do we want to leave the behaviour this way in gnucash? Or do we want to
change it when using the result of g_get_home_dir, ifdef'd on G_OS_WIN32?
I'd say we just leave it this way, as only developers will use the msys
shell anyway, but we as developers have to keep in mind this difference.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v188.8.131.52 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the gnucash-devel