Skip anything after an # symbol in the filename.

Windows renames files adding (1), (2) etc. before the .exe in case
of duplicates, which causes the host or key values to be garbled.

This allows to protect from this adding a final "#" symbol to the
filename.
This commit is contained in:
Guido Falsi 2023-04-19 11:46:08 +02:00
parent edec424153
commit bdb590834e

View File

@ -37,6 +37,11 @@ pub fn get_license_from_string(s: &str) -> ResultType<License> {
s
};
if s.contains("host=") {
let s = if s.contains("#") {
&s[0..s.find("#").unwrap_or(s.len())]
} else {
s
};
let strs: Vec<&str> = s.split("host=").collect();
if strs.len() == 2 {
let strs2: Vec<&str> = strs[1].split(",key=").collect();