From 355c7ffbb1504cd06748f126b6ff075f586342b1 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Thu, 17 Jan 2008 09:44:13 +0000 Subject: Fixed a bug when a value contains a - sign. Now it looks for (space)- before splitting up into a variable git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@595 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/getopts.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/getopts.lua b/lib/getopts.lua index 45aca7b..84a8fa8 100644 --- a/lib/getopts.lua +++ b/lib/getopts.lua @@ -17,6 +17,9 @@ function getoptsfromfile (file, search, filter) end if (optstable) then opts[a] = optstable + ---[[ Next line is DEBUG info. Should be commented out! + opts[a]["debug"] = b + -- End debug info. --]] else opts[a] = b end @@ -35,7 +38,7 @@ function opts_to_table ( optstring, filter ) local option = "" local optvalue = "" for j = 1, string.len(optstr) do - if (string.sub(optstr, j, j) == "-") then + if (string.sub(optstr, j, j) == " -") then option=string.sub(optstr, j, j+1) if not (filter) or (filter == option) then for k = j+1, string.len(optstr) do -- cgit v1.2.3