summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-06-15 22:01:52 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-06-15 22:01:52 +0000
commit09e10390fb69feee4980866963ec8338e6c145a4 (patch)
tree1118adec8f6be46a058b97e70b030c2c0923451d /Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua
parent8514e9d43bde2d06fd57c794e2fde4ba4c1102a0 (diff)
lualatex cleverer jobname quoting: now in TeX too
git-svn-id: svn://tug.org/texlive/trunk@22997 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua')
-rw-r--r--Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua11
1 files changed, 2 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua b/Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua
index 9009864e52c..1809a67874d 100644
--- a/Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua
+++ b/Master/texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua
@@ -1,11 +1,7 @@
-- $Id: lualatexquotejobname.tex 22957 2011-06-13 20:49:26Z mpg $
-- Manuel Pegourie-Gonnard, originally written 2010. WTFPL v2.
--
--- Used in lualatexquotejobname.tex
---
--- Try to replicate web2c's function normalize_quotes() (in lib/texmfmp.c,
--- non-XeTeX version) as closely as possible (that is, exactly except error
--- handling).
+-- Goal: see lualatexquotejobname.tex
--
-- Cache the results of previous calls, not so much for the speed gain which
-- probably doesn't matter, but to avoid repeated error messages.
@@ -18,12 +14,9 @@ callback.register('process_jobname', function(jobname)
local clean, n_quotes = jobname:gsub([["]], [[]])
-- complain if they wasn't an even number of quotes (aka unbalanced)
if n_quotes % 2 ~= 0 then
- -- this code is executed when jobname is first expanded, which is
- -- probably too late for an early exit as in web2c's normalize_quotes()
- -- so, just throw an error without exiting
texio.write_nl('! Unbalanced quotes in jobname: ' .. jobname )
end
- -- add quotes around the clean up jobname if necessary
+ -- add quotes around the cleaned up jobname if necessary
if jobname:find(' ') then
clean = '"' .. clean .. '"'
end