From 32679b19472f53a8cf8066c29e906b67594e5153 Mon Sep 17 00:00:00 2001 From: Fox Date: Tue, 2 Aug 2016 00:07:04 -0700 Subject: [PATCH] fix pessimistic upgrade operator for pre-1.0 versions fixes #1 --- semver.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/semver.lua b/semver.lua index 1b84882..a052034 100644 --- a/semver.lua +++ b/semver.lua @@ -173,6 +173,7 @@ end -- if a and b are versions, a ^ b means "b is backwards-compatible with a" -- in other words, "it's safe to upgrade from a to b" function mt:__pow(other) + if self.major == 0 then return false end return self.major == other.major and self.minor <= other.minor end