diff options
Diffstat (limited to 'Build/source/texk/web2c/mplibdir/mpost.w')
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mpost.w | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/mplibdir/mpost.w b/Build/source/texk/web2c/mplibdir/mpost.w index 9d7096c6f4a..ae572e8bd41 100644 --- a/Build/source/texk/web2c/mplibdir/mpost.w +++ b/Build/source/texk/web2c/mplibdir/mpost.w @@ -1,4 +1,4 @@ -% $Id: mpost.w 1895 2013-03-27 11:17:17Z taco $ +% $Id: mpost.w 1916 2013-06-13 10:19:49Z taco $ % % This file is part of MetaPost; % the MetaPost program is in the public domain. @@ -443,7 +443,7 @@ static int mpost_run_make_mpx (MP mp, char *mpname, char *mpxname) { mpost_xfree(mpversion); } } - + mpost_xfree (cnf_cmd); return (int)(ret == 0); } @@ -1290,6 +1290,17 @@ extern __declspec(dllexport) int DLLPROC (int argc, char **argv); @ Now this is really it: \MP\ starts and ends here. @c +static char *cleaned_invocation_name(char *arg) +{ + char *ret, *dot; + const char *start = xbasename(arg); + ret = xstrdup(start); + dot = strrchr(ret, '.'); + if (dot != NULL) { + *dot = 0; /* chop */ + } + return ret; +} int #if defined(WIN32) && !defined(__MINGW32__) && defined(DLLPROC) DLLPROC (int argc, char **argv) @@ -1306,8 +1317,8 @@ main (int argc, char **argv) options->ini_version = (int)false; options->print_found_names = (int)true; { - const char *base = xbasename(argv[0]); - if (!strcmp(base, "dvitomp") || !strcasecmp(base, "dvitomp.exe")) + const char *base = cleaned_invocation_name(argv[0]); + if (FILESTRCASEEQ(base, "dvitomp")) dvitomp_only=1; } if (dvitomp_only) { |