aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index bafe8ea93..9bf9514f6 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -475,15 +475,20 @@ rspamd_lua_rspamd_version_numeric(lua_State *L)
type = lua_tostring(L, 1);
if (g_ascii_strcasecmp(type, "short") == 0) {
version_num = RSPAMD_VERSION_MAJOR_NUM * 1000 +
- RSPAMD_VERSION_MINOR_NUM * 100;
+ RSPAMD_VERSION_MINOR_NUM * 100 +
+ RSPAMD_VERSION_PATCH_NUM * 10;
}
else if (g_ascii_strcasecmp(type, "main") == 0) {
version_num = RSPAMD_VERSION_MAJOR_NUM * 1000 +
- RSPAMD_VERSION_MINOR_NUM * 100;
+ RSPAMD_VERSION_MINOR_NUM * 100 +
+ RSPAMD_VERSION_PATCH_NUM * 10;
}
else if (g_ascii_strcasecmp(type, "major") == 0) {
version_num = RSPAMD_VERSION_MAJOR_NUM;
}
+ else if (g_ascii_strcasecmp(type, "patch") == 0) {
+ version_num = RSPAMD_VERSION_PATCH_NUM;
+ }
else if (g_ascii_strcasecmp(type, "minor") == 0) {
version_num = RSPAMD_VERSION_MINOR_NUM;
}
@@ -511,7 +516,7 @@ rspamd_lua_rspamd_version(lua_State *L)
"." RSPAMD_VERSION_MINOR;
}
else if (g_ascii_strcasecmp(type, "main") == 0) {
- result = RSPAMD_VERSION_MAJOR "." RSPAMD_VERSION_MINOR;
+ result = RSPAMD_VERSION_MAJOR "." RSPAMD_VERSION_MINOR "." RSPAMD_VERSION_PATCH;
}
else if (g_ascii_strcasecmp(type, "major") == 0) {
result = RSPAMD_VERSION_MAJOR;
@@ -519,6 +524,9 @@ rspamd_lua_rspamd_version(lua_State *L)
else if (g_ascii_strcasecmp(type, "minor") == 0) {
result = RSPAMD_VERSION_MINOR;
}
+ else if (g_ascii_strcasecmp(type, "patch") == 0) {
+ result = RSPAMD_VERSION_PATCH;
+ }
else if (g_ascii_strcasecmp(type, "id") == 0) {
result = RID;
}