summaryrefslogtreecommitdiffstats
path: root/lib/getopts.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-07-10 20:29:29 +0000
committerTed Trask <ttrask01@yahoo.com>2008-07-10 20:29:29 +0000
commit43a9488d38abb2ea6001afd8c6c36433bf44bc71 (patch)
tree7481edf0b7e037ecdb3bb096d5111e3605dc719b /lib/getopts.lua
parent0c011f565a24bffe9065f67fabf5db57b2be80d9 (diff)
downloadacf-core-43a9488d38abb2ea6001afd8c6c36433bf44bc71.tar.bz2
acf-core-43a9488d38abb2ea6001afd8c6c36433bf44bc71.tar.xz
Added finishingorder to displayform in viewfunctions to specify fields that go at the end. Fixed bug in getopts that ignored the last line if no trailing carriage return.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1294 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/getopts.lua')
-rw-r--r--lib/getopts.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/getopts.lua b/lib/getopts.lua
index 874d70d..0579bd3 100644
--- a/lib/getopts.lua
+++ b/lib/getopts.lua
@@ -87,6 +87,10 @@ function setoptsinfile (file, search_section, search_name, value, to_table, opti
for line in string.gmatch(file, "([^\n]*)\n") do
conf_file[#conf_file + 1] = line
end
+ local extra = string.match(file,"([^\n]*)$")
+ if extra ~= "" then
+ conf_file[#conf_file + 1] = extra
+ end
end
local new_conf_file = {}
local section = ""
@@ -163,6 +167,10 @@ function getoptsfromfile (file, search_section, search_name, to_table, filter)
for line in string.gmatch(file, "([^\n]*)\n") do
conf_file[#conf_file + 1] = line
end
+ local extra = string.match(file,"([^\n]*)$")
+ if extra ~= "" then
+ conf_file[#conf_file + 1] = extra
+ end
end
local section = ""
local skip_lines = 0