diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-06-05 17:49:48 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-06-05 17:49:48 +0000 |
commit | 75617fdbeb435ab6329c8a887785d508eaf94d59 (patch) | |
tree | 6f872844edaed578d42c48fd5bde67abf419e98f | |
parent | 68c7979c8ed1628fee78b9c47214997e0c47f0e2 (diff) | |
download | acf-alpine-baselayout-75617fdbeb435ab6329c8a887785d508eaf94d59.tar.bz2 acf-alpine-baselayout-75617fdbeb435ab6329c8a887785d508eaf94d59.tar.xz |
Fixed bug on invalid skin name
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1202 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | skins-model.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/skins-model.lua b/skins-model.lua index e637023..f4b4de6 100644 --- a/skins-model.lua +++ b/skins-model.lua @@ -6,7 +6,7 @@ local function set_skins(skin) local f, errtxt = io.popen(cmd) local cmdoutput = f:read("*a") f:close() - return cfe({ value=cmdoutput, errtxt=errtxt, label="Set skin result" }) + return cmdoutput, errtxt end local function list_skins() @@ -32,9 +32,12 @@ end update = function (newskin) -- Make sure no one can inject code into the model. local availableskins = list_skins() + local cmdoutput = "Failed to set skin" + local errtxt = "Invalid selection" for i,skin in ipairs(availableskins.value) do if ( skin.value == newskin) then - return set_skins(newskin) + cmdoutput, errtxt = set_skins(newskin) end end + return cfe({ value=cmdoutput, errtxt=errtxt, label="Set skin result" }) end |