win32: g_get_home_dir gives different directory in msys vs. non-msys

Christian Stimming stimming at tuhh.de
Mon Feb 12 08:17:06 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRdBo0mXAi+BfhivFAQJLrQP9ElCznC5pO7/ykR7SQRahu6Idp0dnYP9w
WgZC/ftuqm8Ry0TJ72xn4uIdDc+k19RnlAskYdj3/odMwWbhuWeJLvE2iy/i+DLB
cVJD9TwA+73uq1GF5L73ZH/W8ew34VKowjk6/56Tl5UyLNRDR95eBk0S+DzWma5P
xlNH59CfCmY=
=UJGs
-----END PGP SIGNATURE-----


More information about the gnucash-devel mailing list