]> code.delx.au - gnu-emacs/commitdiff
(main): Call GetShortPathName to normalize program
authorAndrew Innes <andrewi@gnu.org>
Thu, 25 Mar 1999 22:54:17 +0000 (22:54 +0000)
committerAndrew Innes <andrewi@gnu.org>
Thu, 25 Mar 1999 22:54:17 +0000 (22:54 +0000)
names for comparison.

nt/cmdproxy.c

index 16f24065d02ad2386ee774659c57a5b934c60ade..9b50cfe0d27ba38eb220080dba4d4e1bc13a5b70 100644 (file)
@@ -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