From 90bd6e0c226ab316643fe0e1ffad2496c0d1948d Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Thu, 24 Jan 2008 14:57:29 +0000 Subject: Minor changes on tables git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@636 ab2d0c66-481e-0410-8bed-d214d4d58bed --- lib/getopts.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/getopts.lua') diff --git a/lib/getopts.lua b/lib/getopts.lua index 84a8fa8..4aa433c 100644 --- a/lib/getopts.lua +++ b/lib/getopts.lua @@ -38,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 @@ -46,11 +46,11 @@ function opts_to_table ( optstring, filter ) optsparams = {} end if (string.sub(optstr, k, k) == "-") then - optsparams[option] = string.match(string.sub(optstr, j+2, k-1),"^%s*(.*)%s?") + optsparams[option] = string.match(string.sub(optstr, j+2, k-1),"^%s*(.-)%s*$") break end if (k == string.len(optstr)) then - optsparams[option] = string.match(string.sub(optstr, j+2, k),"^%s*(.*)%s?") + optsparams[option] = string.match(string.sub(optstr, j+2, k),"^%s*(.-)%s*$") break end end -- cgit v1.2.3