summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-07-05 09:06:38 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-07-05 09:06:38 +0000
commitcf1fc7b4d3f71633ca71e17dd7044722d19ceda4 (patch)
tree5ba3680df0c5362e3f3137ed207d76f70b745caf /Build
parent1a6220d23fab3c902247d61da5771bfae9a2450c (diff)
luatex, mpost, omfonts: Use kpse_program_basename()
git-svn-id: svn://tug.org/texlive/trunk@31094 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.w25
-rw-r--r--Build/source/texk/web2c/mplibdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/mplibdir/mpost.w14
-rw-r--r--Build/source/texk/web2c/omegafonts/ChangeLog4
-rw-r--r--Build/source/texk/web2c/omegafonts/omfonts.c11
6 files changed, 26 insertions, 37 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index b7b5d8039f4..0c7cf60468b 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-05 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * lua/luainit.w (init_kpse, lua_initialize):
+ Use kpse_program_basename().
+
2013-07-04 Peter Breitenlohner <peb@mppmu.mpg.de>
* luaimage.test, tests/luaimage.tex: New test and data.
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w
index 90b970c648c..5f8f12d5592 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w
@@ -43,9 +43,9 @@ In fact, it sets three C variables:
|kpse_invocation_name| |kpse_invocation_short_name| |kpse->program_name|
-and four environment variables:
+and five environment variables:
- SELFAUTOLOC SELFAUTODIR SELFAUTOPARENT progname
+ SELFAUTOLOC SELFAUTODIR SELFAUTOPARENT SELFAUTOGRANDPARENT progname
@c
const_string LUATEX_IHELP[] = {
@@ -478,19 +478,6 @@ static char *find_filename(char *name, const char *envkey)
@ @c
-static char *cleaned_invocation_name(char *arg)
-{
- char *ret, *dot;
- const char *start = xbasename(arg);
- ret = xstrdup(start);
- dot = strchr(ret, '.');
- if (dot != NULL) {
- *dot = 0; /* chop */
- }
- return ret;
-}
-
-@ @c
static void init_kpse(void)
{
@@ -514,11 +501,11 @@ static void init_kpse(void)
user_progname = remove_suffix (input_name);
}
if (!user_progname) {
- user_progname = cleaned_invocation_name(argv[0]);
+ user_progname = kpse_program_basename(argv[0]);
}
} else {
if (!dump_name) {
- dump_name = cleaned_invocation_name(argv[0]);
+ dump_name = kpse_program_basename(argv[0]);
}
user_progname = dump_name;
}
@@ -787,11 +774,11 @@ void lua_initialize(int ac, char **av)
}
ptexbanner = banner;
- kpse_invocation_name = cleaned_invocation_name(argv[0]);
+ kpse_invocation_name = kpse_program_basename(argv[0]);
/* be 'luac' */
if (argc >1) {
- if (STREQ(kpse_invocation_name, "texluac"))
+ if (FILESTRCASEEQ(kpse_invocation_name, "texluac"))
exit(luac_main(ac, av));
if (STREQ(argv[1], "--luaconly") || STREQ(argv[1], "--luac")) {
strcpy(av[1], "luatex");
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog
index f701505055a..86c72ec9baa 100644
--- a/Build/source/texk/web2c/mplibdir/ChangeLog
+++ b/Build/source/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-05 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * mpost.w (main): Use kpse_program_basename().
+
2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* pngout.w: Replace index() => strchr().
diff --git a/Build/source/texk/web2c/mplibdir/mpost.w b/Build/source/texk/web2c/mplibdir/mpost.w
index ae572e8bd41..a3f03409e12 100644
--- a/Build/source/texk/web2c/mplibdir/mpost.w
+++ b/Build/source/texk/web2c/mplibdir/mpost.w
@@ -1290,17 +1290,6 @@ 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)
@@ -1317,9 +1306,10 @@ main (int argc, char **argv)
options->ini_version = (int)false;
options->print_found_names = (int)true;
{
- const char *base = cleaned_invocation_name(argv[0]);
+ char *base = kpse_program_basename(argv[0]);
if (FILESTRCASEEQ(base, "dvitomp"))
dvitomp_only=1;
+ free(base);
}
if (dvitomp_only) {
@<Read and set dvitomp command line options@>;
diff --git a/Build/source/texk/web2c/omegafonts/ChangeLog b/Build/source/texk/web2c/omegafonts/ChangeLog
index 7bcd9e1635d..6809118e740 100644
--- a/Build/source/texk/web2c/omegafonts/ChangeLog
+++ b/Build/source/texk/web2c/omegafonts/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-05 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * omfonts.c (main): Use kpse_program_basename().
+
2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* pl-lexer.l: Add '#include <kpathsea/c-memstr.h>' for strlen().
diff --git a/Build/source/texk/web2c/omegafonts/omfonts.c b/Build/source/texk/web2c/omegafonts/omfonts.c
index bd9b2e60395..afd94cff68f 100644
--- a/Build/source/texk/web2c/omegafonts/omfonts.c
+++ b/Build/source/texk/web2c/omegafonts/omfonts.c
@@ -122,15 +122,14 @@ main (int argc, string *argv)
int getopt_return_val;
int option_index = 0;
- name_program = xbasename(argv[0]);
-#define PROG_IS(s) !strcasecmp(name_program, s) || !strcasecmp(name_program, s ".exe")
- if (PROG_IS("ofm2opl"))
+ name_program = kpse_program_basename(argv[0]);
+ if (FILESTRCASEEQ(name_program, "ofm2opl"))
program = PROG_OFM2OPL;
- else if (PROG_IS("opl2ofm"))
+ else if (FILESTRCASEEQ(name_program, "opl2ofm"))
program = PROG_OPL2OFM;
- else if (PROG_IS("ovf2ovp"))
+ else if (FILESTRCASEEQ(name_program, "ovf2ovp"))
program = PROG_OVF2OVP;
- else if (PROG_IS("ovp2ovf"))
+ else if (FILESTRCASEEQ(name_program, "ovp2ovf"))
program = PROG_OVP2OVF;
else
program = PROG_OMFONTS;