From 3e76a2e64b949b5db162731a9eec27230b9bd8da Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Thu, 24 Jan 2013 18:56:26 +0100 Subject: [PATCH] Remove e2lib.chomp() and e2lib.read_configuration() Both are unused. Signed-off-by: Tobias Ulmer --- generic/e2lib.lua | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/generic/e2lib.lua b/generic/e2lib.lua index ece6c29..e782354 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -638,15 +638,6 @@ function e2lib.is_backup_file(path) return string.find(path, "~$") or string.find(path, "^#.*#$") end -function e2lib.chomp(str, chr) - local chr = chr or "/" - if string.sub(str, -1, -1) == chr then - return string.sub(str, 1, -2) - else - return str - end -end - --- quotes a string so it can be safely passed to a shell -- @param str string to quote -- @return quoted string @@ -767,35 +758,6 @@ function e2lib.read_line(path) return l end --- Iterators --- --- These iterators are convenience functions for use in "for" statements. --- --- read_configuration(PATH) --- --- Returns the successive non-empty lines contained in the file PATH. --- Comments (of the form "# ...") are removed. -function e2lib.read_configuration(p) - if e2util.exists(p) then - local function nextline(s) - while true do - local ln = s:read("*l") - if not ln then - s:close() - return nil - elseif not string.find(ln, "^%s*#") and string.find(ln, "%S") then - local s = string.find(ln, "#.*") - if s then return string.sub(ln, 1, s - 1) - else return ln end - end - end - end - return nextline, io.open(p) - else - e2lib.abort("no such file: " .. p) - end -end - --- read the global config file -- local tools call this function inside collect_project_info() -- global tools must call this function after parsing command line options -- 2.39.5