From 43a9488d38abb2ea6001afd8c6c36433bf44bc71 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Jul 2008 20:29:29 +0000 Subject: 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 --- lib/getopts.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/getopts.lua') 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 -- cgit v1.2.3