Skip to content

W32: swap special g_get_prgname() for platform_get_argv0()

LRN requested to merge lrn/glib:w32-argv0 into master

Commit 398008da added a W32-only code (from commit 7e0e251a) to g_get_prgname() that makes this function never return NULL. This is inconsistent with the other platforms. Revert the change, and add an implementation for platform_get_argv0(), which is used by GOption when g_get_prgname() == NULL.

The W32 platform_get_argv0() code is different from the one that was in g_get_prgname(), because it should be getting argv0, not the name of the executable that is being run (although most of the time they are one and the same).

Adjust thest option-argv0 test to expect it to pass on W32.

Merge request reports