summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2010-04-22 20:42:32 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2010-04-22 20:42:32 +0000
commit26ab3812ef5ec1e9b62810807841661658f2b4e9 (patch)
tree2eddf1fe2de568c681537de29fdc9f77799dde11 /Master
parentf2705e9be414cd3c3bffc90919fea7c70cd3a0c5 (diff)
- ensure only backslash is used in USERPROFILE variable
(Adobe Reader crash case) - fixed argument processing for direct execution under texlua - more doc tweaks git-svn-id: svn://tug.org/texlive/trunk@17963 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/bin/win32/runscript.tlu28
1 files changed, 19 insertions, 9 deletions
diff --git a/Master/bin/win32/runscript.tlu b/Master/bin/win32/runscript.tlu
index 718fdb938c2..95e9ddbb3cb 100644
--- a/Master/bin/win32/runscript.tlu
+++ b/Master/bin/win32/runscript.tlu
@@ -48,13 +48,13 @@ local helpstr = [[
Tcl (.tcl) -- requires installation
Java (.jar) -- requires installation
VBScript (.vbs) -- part of Windows
- Jscript (.js) -- part of Windows
+ JScript (.js) -- part of Windows
Batch (.bat;.cmd) -- part of Windows
- For Unix-style extensionless scripts the first line of the script is
- consulted for a she-bang (#!) specification of the interpreter
- program. This can be an arbitrary program but it must be present on
- the search path.
+ Finally, Unix-style extensionless scripts are searched as last and
+ the interpreter program is established based on the she-bang (#!)
+ specification on the very first line of the script. This can be
+ an arbitrary program but it must be present on the search path.
Next, the script program needs to be installed somewhere below the
'scripts' directory under one of the TEXMF trees (consult the
@@ -71,7 +71,9 @@ local helpstr = [[
kpsewhich --format=texmfscripts <script-name>.<ext>
- Once installed the script can be called immediately with:
+ This should output the full path to the script if everything is
+ properly installed and configured. If this test is successful,
+ the script can be run immediately with:
runscript <script-name> [script arguments]
@@ -119,7 +121,8 @@ local docstr = [[
process. The system shell (cmd.exe) is never called (except for
batch scripts, of course). If the located script happens to be
a (tex)lua script, it is loaded and called internally from within
- this script, i.e. no new process is spawned.
+ this script, i.e. no new process is spawned. Execution is done
+ using a protected call, so any compile or runtime errors are catched.
Source files
@@ -191,6 +194,11 @@ local docstr = [[
- added tlgs and tlperl to alias_table; callable as e.g.:
runscript tlperl ...
- doc tweaks
+ 2010/04/22
+ - ensure only backslash is used in USERPROFILE variable
+ (Adobe Reader crash case)
+ - fixed argument processing for direct execution under texlua
+ - more doc tweaks
]]
-- HELPER SUBROUTINES --
@@ -308,7 +316,7 @@ else
-- we must be called as: texlua runscript.tlu progname ...
-- this is treated the same as: runscript[.exe] progname ...
-- we don't have the unparsed arument line in this case, so construct one
- for k = 1, #arg do argline = argline..' '.._q(arg[k]) end
+ for k = #arg, 1, -1 do argline = _q(arg[k]) .. ' ' .. argline end
end
-- special behaviour when called under 'runscript' name
@@ -401,6 +409,8 @@ if string.find(','..shell_escape_commands..',', ','..progname..',', 1, true) the
-- because they are not searched for with kpathsea)
os.setenv('TEXMFSCRIPTS', kpse.var_value('TEXMF_RESTRICTED_SCRIPTS'))
end
+-- Adobe Reader crash case: make sure USERPROFILE is not "slashed"
+os.setenv("USERPROFILE", os.getenv("USERPROFILE"):gsub('/', '\\'))
-- alias table (programs with special needs)
@@ -536,7 +546,7 @@ end
end -- MAIN_CHUNK
--- execute main_proc with pcall to catch any runtime errors
+-- execute MAIN_CHUNK with pcall to catch any runtime errors
local success, errormsg = pcall(MAIN_CHUNK)
if not success then