From 615c2f9ba24e20b510d6e1ed0a86451d73bed356 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Wed, 29 Jan 2014 14:40:34 +0100 Subject: [PATCH] Fix operator precedence in cvs and svn source validation "not" binds higher, turning these expressions into false == "string" on errors. src.tag not being set causes a stack trace later on. A regression test has been added. Signed-off-by: Tobias Ulmer --- local/cvs.lua | 2 +- local/svn.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/local/cvs.lua b/local/cvs.lua index c627656..7b2599c 100644 --- a/local/cvs.lua +++ b/local/cvs.lua @@ -85,7 +85,7 @@ function cvs.validate_source(info, sourcename) if not src.branch then e:append("source has no `branch' attribute") end - if not type(src.tag) == "string" then + if type(src.tag) ~= "string" then e:append("source has no `tag' attribute or tag attribute has wrong type") end if not src.module then diff --git a/local/svn.lua b/local/svn.lua index 185c7cb..d78ac23 100644 --- a/local/svn.lua +++ b/local/svn.lua @@ -365,10 +365,10 @@ function svn.validate_source(info, sourcename) if not src.branch then e:append("source has no `branch' attribute") end - if not type(src.tag) == "string" then + if type(src.tag) ~= "string" then e:append("source has no `tag' attribute or tag attribute has wrong type") end - if not type(src.workingcopy_subdir) == "string" then + if type(src.workingcopy_subdir) ~= "string" then e2lib.warnf("WDEFAULT", "in source %s", sourcename) e2lib.warnf("WDEFAULT", " workingcopy_subdir defaults to the branch: %s", src.branch) -- 2.39.5