]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
strip ; prefix before giving code to lua
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 15 Mar 2018 12:49:39 +0000 (13:49 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 15 Mar 2018 12:49:39 +0000 (13:49 +0100)
pdns/lua-record.cc

index 2f1c3d02141c67b2914ed6bdc1e6de91cc37925f..fac8ac201635e0f3882160d7785b37248e87140c 100644 (file)
@@ -809,8 +809,9 @@ std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, cons
   try {
     string actual;
     if(!code.empty() && code[0]!=';')
-      actual = "return ";
-    actual+=code;
+      actual = "return " + code;
+    else
+      actual = code.substr(1);
 
     auto content=lua.executeCode<boost::variant<string, vector<pair<int, string> > > >(actual);