diff options
| -rw-r--r-- | nt/cmdproxy.c | 6 |
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) | |||
| 466 | 466 | ||
| 467 | /* Although Emacs always sets argv[0] to an absolute pathname, we | 467 | /* Although Emacs always sets argv[0] to an absolute pathname, we |
| 468 | might get run in other ways as well, so convert argv[0] to an | 468 | might get run in other ways as well, so convert argv[0] to an |
| 469 | absolute name before comparing to the module name. */ | 469 | absolute name before comparing to the module name. Don't get |
| 470 | caught out by mixed short and long names. */ | ||
| 471 | GetShortPathName (modname, modname, sizeof (modname)); | ||
| 472 | path[0] = '\0'; | ||
| 470 | if (!SearchPath (NULL, argv[0], ".exe", sizeof (path), path, &progname) | 473 | if (!SearchPath (NULL, argv[0], ".exe", sizeof (path), path, &progname) |
| 474 | || !GetShortPathName (path, path, sizeof (path)) | ||
| 471 | || stricmp (modname, path) != 0) | 475 | || stricmp (modname, path) != 0) |
| 472 | { | 476 | { |
| 473 | /* We are being used as a helper to run a DOS app; just pass | 477 | /* We are being used as a helper to run a DOS app; just pass |