diff options
author | Paul Smith <psmith@gnu.org> | 2005-02-26 01:41:48 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2005-02-26 01:41:48 +0000 |
commit | 9d153cc1b1e467cd6245755c32f78efbd62142c2 (patch) | |
tree | 229919252d0b4a25e1e5c00d80ab744fbe5b5c81 /main.c | |
parent | 6d995b036e714ea3d61112ebc582b0671cc36e77 (diff) | |
download | gunmake-9d153cc1b1e467cd6245755c32f78efbd62142c2.tar.gz |
Add configure operations to support MINGW on Windows.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -1026,6 +1026,25 @@ main (int argc, char **argv, char **envp) if (program == 0 && argv[0][1] == ':') program = argv[0] + 1; #endif +#ifdef WINDOWS32 + if (program == 0) + { + /* Extract program from full path */ + int argv0_len; + char *p = strrchr (argv[0], '\\'); + if (!p) + p = argv[0]; + argv0_len = strlen(p); + if (argv0_len > 4 + && streq (&p[argv0_len - 4], ".exe")) + { + /* Remove .exe extension */ + p[argv0_len - 4] = '\0'; + /* Increment past the initial '\' */ + program = p + 1; + } + } +#endif if (program == 0) program = argv[0]; else |