From 4d033a89cb3f2d314e320104b7e2654beb5f8a91 Mon Sep 17 00:00:00 2001 From: Yau Yimsing <874925685@qq.com> Date: Fri, 9 Jun 2023 09:37:44 +0800 Subject: [PATCH] #675 fix wrong generated version for double number --- src/win32/configure.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/win32/configure.js b/src/win32/configure.js index 6c96a90a6..5a579b9e5 100644 --- a/src/win32/configure.js +++ b/src/win32/configure.js @@ -61,7 +61,9 @@ function readVersion() { } else if (s.search(/^m4_define\(\[libmodbus_version_minor/) != -1) { verMinor = s.substr(s.indexOf(",") + 3, 1); } else if (s.search(/^m4_define\(\[libmodbus_version_micro/) != -1) { - verMicro = s.substr(s.indexOf(",") + 3, 1); + str_start_idx = s.indexOf(",") + 3; + num_str_length = s.length - str_start_idx - 2; + verMicro = s.substr(str_start_idx, num_str_length); } } cf.Close();