From 6653bf15788592e34d1e5acce850142c15e52b46 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 29 Sep 2008 18:01:28 +0000 Subject: Removed getopts library and added functionality to format library as opts_to_table, table_to_opts, parse_configfile2, update_configfile2, get_section, and set_section. New functions work on strings, not files. Modified all code using getopts to use format instead. Fixed nil string bugs in TCPProxy. Fixed forward only bug in DNSCache. git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1535 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/fs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/fs.lua') diff --git a/lib/fs.lua b/lib/fs.lua index fa58058..90c0729 100644 --- a/lib/fs.lua +++ b/lib/fs.lua @@ -64,7 +64,7 @@ end function write_file ( path, str ) local file = io.open(path, "w") --append a newline char to EOF - str = str .. "\n" + str = string.gsub(str, "\n*$", "\n") if ( file ) then file:write(str) file:close() -- cgit v1.2.3