diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-10-28 19:38:16 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-10-28 19:38:16 +0000 |
commit | 06c12c2ea537b6d33d5a649fd657afc604face4d (patch) | |
tree | 6975528f11978f520900104ea1aaa31733bb7f74 | |
parent | c0e97287356157dfdeaba0914863761b72fb59fb (diff) | |
download | acf-lib-06c12c2ea537b6d33d5a649fd657afc604face4d.tar.bz2 acf-lib-06c12c2ea537b6d33d5a649fd657afc604face4d.tar.xz |
Minor bug in db.lua when host or port are blank string
-rw-r--r-- | db.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -167,15 +167,16 @@ export.listdatabases = function(dbobject) local result = {} if dbobject.engine == mymodule.engine.postgresql then local cmd = {"psql", "-U", "postgres", "-lt"} - if dbobject.host then + if dbobject.host and dbobject.host ~= "" then cmd[#cmd+1] = "-h" cmd[#cmd+1] = dbobject.host end - if dbobject.port then + if dbobject.port and dbobject.port ~= "" then cmd[#cmd+1] = "-p" cmd[#cmd+1] = dbobject.port end cmd["stderr"]=subprocess.STDOUT +APP.logevent("calling: "..table.concat(cmd, " ")) local code, cmdresult = subprocess.call_capture(cmd) if code ~= 0 then error(cmdresult, 0) |