summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua/luainit.w
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2010-04-20 14:22:21 +0000
committerTaco Hoekwater <taco@elvenkind.com>2010-04-20 14:22:21 +0000
commit05f8d0158547b0198f0615e2b5dd51542ba48b41 (patch)
treecf1624e4a0cf28e07fd2c197ad5507791167025d /Build/source/texk/web2c/luatexdir/lua/luainit.w
parentfb7b7f390bf542b5455bf9aae21fb48d8efb1f65 (diff)
new luatex HEAD
git-svn-id: svn://tug.org/texlive/trunk@17944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua/luainit.w')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.w56
1 files changed, 28 insertions, 28 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.w b/Build/source/texk/web2c/luatexdir/lua/luainit.w
index 3393716b36a..1e5f8681ba5 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.w
@@ -28,7 +28,7 @@
#include "ptexlib.h"
static const char _svn_version[] =
- "$Id: luainit.w 3612 2010-04-13 09:29:42Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/lua/luainit.w $";
+ "$Id: luainit.w 3621 2010-04-15 16:08:22Z taco $ $URL: http://foundry.supelec.fr/svn/luatex/branches/0.60.x/source/texk/web2c/luatexdir/lua/luainit.w $";
@
TH: TODO
@@ -224,6 +224,11 @@ static void parse_options(int argc, char **argv)
int option_index;
char *firstfile = NULL;
opterr = 0; /* dont whine */
+ if ((strstr(argv[0], "luatexlua") != NULL) ||
+ (strstr(argv[0], "texlua") != NULL)) {
+ lua_only = 1;
+ luainit = 1;
+ }
for (;;) {
g = getopt_long_only(argc, argv, "+", long_options, &option_index);
@@ -356,42 +361,37 @@ static void parse_options(int argc, char **argv)
uexit(0);
}
}
- /* attempt to find |dump_name| */
- if (argv[optind] && argv[optind][0] == '&') {
+ /* attempt to find |input_name| / |dump_name| */
+ if (lua_only) {
+ if (argv[optind]) {
+ startup_filename = strdup(argv[optind]);
+ lua_offset = optind;
+ }
+ } else if (argv[optind] && argv[optind][0] == '&') {
dump_name = strdup(argv[optind] + 1);
} else if (argv[optind] && argv[optind][0] != '\\') {
if (argv[optind][0] == '*') {
input_name = strdup(argv[optind] + 1);
} else {
firstfile = strdup(argv[optind]);
- if (lua_only) {
- startup_filename = firstfile;
- } else {
- if ((strstr(firstfile, ".lua") ==
- firstfile + strlen(firstfile) - 4)
- || (strstr(firstfile, ".luc") ==
- firstfile + strlen(firstfile) - 4)
- || (strstr(firstfile, ".LUA") ==
- firstfile + strlen(firstfile) - 4)
- || (strstr(firstfile, ".LUC") ==
- firstfile + strlen(firstfile) - 4)
- || (strstr(argv[0], "luatexlua") != NULL)
- || (strstr(argv[0], "texlua") != NULL)) {
- startup_filename = firstfile;
- lua_only = 1;
- lua_offset = optind;
- luainit = 1;
- } else {
- input_name = firstfile;
+ if ((strstr(firstfile, ".lua") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(firstfile, ".luc") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(firstfile, ".LUA") ==
+ firstfile + strlen(firstfile) - 4)
+ || (strstr(firstfile, ".LUC") ==
+ firstfile + strlen(firstfile) - 4)) {
+ if (startup_filename == NULL) {
+ startup_filename = firstfile;
+ lua_offset = optind;
+ lua_only = 1;
+ luainit = 1;
}
+ } else {
+ input_name = firstfile;
}
}
- } else {
- if ((strstr(argv[0], "luatexlua") != NULL) ||
- (strstr(argv[0], "texlua") != NULL)) {
- lua_only = 1;
- luainit = 1;
- }
}
if (safer_option) /* --safer implies --nosocket */
nosocket_option = 1;