On Windows, GetEnvironmentVariable() returns 0 for empty variables.
Checking GetLastError() == ERROR_ENVVAR_NOT_FOUND helps make a
difference between a variable that does not exist or an empty one
which should return "".
https://bugzilla.gnome.org/show_bug.cgi?id=679617
if (len == 0)
{
g_free (wname);
- return NULL;
+ if (GetLastError () == ERROR_ENVVAR_NOT_FOUND)
+ return NULL;
+
+ quark = g_quark_from_static_string ("");
+ return g_quark_to_string (quark);
}
else if (len == 1)
len = 2;