summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/buff-ini.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-05-08 22:36:52 +0000
committerKarl Berry <karl@freefriends.org>2015-05-08 22:36:52 +0000
commit5dc3418fd91c83782dce77f0b65549e14f118f51 (patch)
tree9b4ec94c1bb0be9831fd3b887de69df098d46211 /Master/texmf-dist/tex/context/base/buff-ini.lua
parentb810c0301dd20283addb956384210b7926eef35d (diff)
context
git-svn-id: svn://tug.org/texlive/trunk@37284 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/buff-ini.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/buff-ini.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/buff-ini.lua b/Master/texmf-dist/tex/context/base/buff-ini.lua
index 1ad3c905ade..dafe2ad0e75 100644
--- a/Master/texmf-dist/tex/context/base/buff-ini.lua
+++ b/Master/texmf-dist/tex/context/base/buff-ini.lua
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['buff-ini'] = {
local concat = table.concat
local type, next, load = type, next, load
local sub, format = string.sub, string.format
-local splitlines, validstring = string.splitlines, string.valid
+local splitlines, validstring, replacenewlines = string.splitlines, string.valid, string.replacenewlines
local P, Cs, patterns, lpegmatch = lpeg.P, lpeg.Cs, lpeg.patterns, lpeg.match
local utfchar = utf.char
local totable = string.totable
@@ -157,12 +157,14 @@ local function collectcontent(name,separator) -- no print
t[n] = c
end
end
- return concat(t,separator or "\n") -- was \r
+ -- the default separator was \r, then \n and is now os.newline because buffers
+ -- can be loaded in other applications
+ return concat(t,separator or os.newline)
end
end
local function loadcontent(name) -- no print
- local content = collectcontent(name,"\n")
+ local content = collectcontent(name,"\n") -- tex likes \n
local ok, err = load(content)
if ok then
return ok()
@@ -454,7 +456,7 @@ local function savebuffer(list,name,prefix) -- name is optional
if prefix == v_yes then
name = addsuffix(tex.jobname .. "-" .. name,"tmp")
end
- io.savedata(name,content)
+ io.savedata(name,replacenewlines(content))
end
implement {