File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,10 @@ where
6262 let mut locations = vec ! [ ] ;
6363
6464 for ( varname, suffixes) in rules {
65- let Some ( program_files_dir) = var_os_func ( varname) . map ( PathBuf :: from) else { continue } ;
66- if program_files_dir. is_relative ( ) {
67- // This shouldn't happen, but if it does then don't use the path. This is mainly in
68- // case we are accidentally invoked with the environment variable set but empty.
65+ let Some ( program_files_dir) = var_os_func ( varname) . map ( PathBuf :: from) . filter ( |p| p. is_absolute ( ) ) else {
66+ // The environment variable is unset or somehow not an absolute path (e.g. an empty string).
6967 continue ;
70- }
68+ } ;
7169 for suffix in suffixes {
7270 let location = program_files_dir. join ( suffix) ;
7371 if !locations. contains ( & location) {
You can’t perform that action at this time.
0 commit comments