summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-07-04 03:50:59 +0000
committerPaul Smith <psmith@gnu.org>2005-07-04 03:50:59 +0000
commit0e30f46a624803455dcc74acf9a333666467d253 (patch)
treeff09a8876c7bd4e23d6265a49cdd6a8e3b85595c /main.c
parent7dfa2461c32020f56a55239830b280752b1748a1 (diff)
downloadgunmake-0e30f46a624803455dcc74acf9a333666467d253.tar.gz
Various fixes and updates from testers of the beta3 release (mostly Windows
and OS/2 changes).
Diffstat (limited to 'main.c')
-rw-r--r--main.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/main.c b/main.c
index b7db067..776d0ed 100644
--- a/main.c
+++ b/main.c
@@ -1048,17 +1048,13 @@ main (int argc, char **argv, char **envp)
{
/* 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"))
+ program = strrchr (argv[0], '\\');
+ if (program)
{
- /* Remove .exe extension */
- p[argv0_len - 4] = '\0';
- /* Increment past the initial '\' */
- program = p + 1;
+ argv0_len = strlen(program);
+ if (argv0_len > 4 && streq (&program[argv0_len - 4], ".exe"))
+ /* Remove .exe extension */
+ program[argv0_len - 4] = '\0';
}
}
#endif