Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.js generate version not correct #675

Open
alongL opened this issue Dec 28, 2022 · 1 comment
Open

configure.js generate version not correct #675

alongL opened this issue Dec 28, 2022 · 1 comment

Comments

@alongL
Copy link
Contributor

alongL commented Dec 28, 2022

Now the version of libmodbus is 3.1.10, but this script generate version 3.1.1
Maybe verMicro = s.substr(s.indexOf(",") + 3, 1); should be modified.
s.substr(s.indexOf(",") + 3, 2) is rude.
I'm not familar with vbs. Who can do this?

function readVersion() {
    var fso, cf, ln, s;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    cf = fso.OpenTextFile(configFile, 1);
    while (cf.AtEndOfStream !== true) {
        ln = cf.ReadLine();
        s = new String(ln);
        if (s.search(/^m4_define\(\[libmodbus_version_major/) != -1) {
            verMajor = s.substr(s.indexOf(",") + 3, 1);
        } 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);   //this line 
        }
    }
    cf.Close();
}
yauyimsing added a commit to yauyimsing/libmodbus that referenced this issue Jun 9, 2023
@yauyimsing
Copy link

replace line 63 with follow:

    } else if (s.search(/^m4_define\(\[libmodbus_version_micro/) != -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);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants