summaryrefslogtreecommitdiff
path: root/nt/cmdproxy.c
diff options
context:
space:
mode:
authorAndrew Innes <andrewi@gnu.org>1999-03-25 22:54:17 +0000
committerAndrew Innes <andrewi@gnu.org>1999-03-25 22:54:17 +0000
commita5e8ac59ad5fe4400cd96fe863f4b52aadb8e2c6 (patch)
treee06e0c79c48bfc741098a050e4241adfa878bda7 /nt/cmdproxy.c
parent224116b8e99390589b34a51785423d6623ebeb0a (diff)
downloademacs-a5e8ac59ad5fe4400cd96fe863f4b52aadb8e2c6.tar.gz
(main): Call GetShortPathName to normalize program
names for comparison.
Diffstat (limited to 'nt/cmdproxy.c')
-rw-r--r--nt/cmdproxy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 16f24065d02..9b50cfe0d27 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -466,8 +466,12 @@ main (int argc, char ** argv)
/* Although Emacs always sets argv[0] to an absolute pathname, we
might get run in other ways as well, so convert argv[0] to an
- absolute name before comparing to the module name. */
+ absolute name before comparing to the module name. Don't get
+ caught out by mixed short and long names. */
+ GetShortPathName (modname, modname, sizeof (modname));
+ path[0] = '\0';
if (!SearchPath (NULL, argv[0], ".exe", sizeof (path), path, &progname)
+ || !GetShortPathName (path, path, sizeof (path))
|| stricmp (modname, path) != 0)
{
/* We are being used as a helper to run a DOS app; just pass