prosodyctl: Pop arg items after use. Fixes #306
authorKim Alvefur <zash@zash.se>
Wed, 9 Jan 2013 19:40:44 +0000 (20:40 +0100)
committerKim Alvefur <zash@zash.se>
Wed, 9 Jan 2013 19:40:44 +0000 (20:40 +0100)
prosodyctl

index 134624b272126b0d65e195ae957841db1390b661..25acbc6ab90f8e6159d449b852f2d04690ec705c 100755 (executable)
@@ -67,10 +67,10 @@ do
        local filename;
        if arg[1] == "--config" and arg[2] then
                table.insert(filenames, arg[2]);
-               table.remove(arg, 1); table.remove(arg, 1);
                if CFG_CONFIGDIR then
                        table.insert(filenames, CFG_CONFIGDIR.."/"..arg[2]);
                end
+               table.remove(arg, 1); table.remove(arg, 1);
        else
                for _, format in ipairs(config.parsers()) do
                        table.insert(filenames, (CFG_CONFIGDIR or ".").."/prosody.cfg."..format);