1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.util: fix a wrong path analysis when parsing 'mod_name' (fix #18970) (#19090)

This commit is contained in:
shove 2023-08-10 10:42:59 +08:00 committed by GitHub
parent 76b4c92848
commit 65a493d023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,7 +152,7 @@ fn mod_path_to_full_name(pref_ &pref.Preferences, mod string, path string) !stri
}
if last_v_mod > -1 {
mod_full_name := try_path_parts[last_v_mod..].join('.')
return mod_full_name
return if mod_full_name.len < mod.len { mod } else { mod_full_name }
}
}
}