This is an improved version of PR #637.
No more "--" - not needed. No guard for is_osx_bundle() under Windows - does not belong here. Split into proper sequential commits. Fixed the encoding of options and doc_name. Fixed the OSX bundle executable name. Created a function to return the reproduced arguments instead of exposing global variables. Re-tested under Windows and Linux.
There is only one problem left. As described in PR #637, under Windows, mscvrt often breaks unquoted locale strings on 2+ pieces, considering some characters "spaces". So spawn should quote any argv elements containing locale. But that must obviously be a separate PR. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/653
-- Commit Summary --
* Add reverse option parser to main * Add support for geany executable to utils_resource_dir() * Improve New Window: pass the proper arguments and save configuration
-- File Changes --
M src/libmain.c (121) M src/main.h (2) M src/plugins.c (2) M src/utils.c (111) M src/utils.h (17)
-- Patch Links --
https://github.com/geany/geany/pull/653.patch https://github.com/geany/geany/pull/653.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/653