File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2963,16 +2963,17 @@ impl Build {
2963
2963
/// Returns compiler path, optional modifier name from whitelist, and arguments vec
2964
2964
fn env_tool ( & self , name : & str ) -> Option < ( PathBuf , Option < String > , Vec < String > ) > {
2965
2965
let tool = match self . getenv_with_target_prefixes ( name) {
2966
- Ok ( tool) => tool,
2967
- Err ( _ ) => return None ,
2966
+ Ok ( tool) if !tool . trim ( ) . is_empty ( ) => tool,
2967
+ _ => return None ,
2968
2968
} ;
2969
+ let tool = tool. trim ( ) ;
2969
2970
2970
2971
// If this is an exact path on the filesystem we don't want to do any
2971
2972
// interpretation at all, just pass it on through. This'll hopefully get
2972
2973
// us to support spaces-in-paths.
2973
- if Path :: new ( & * tool) . exists ( ) {
2974
+ if Path :: new ( tool) . exists ( ) {
2974
2975
return Some ( (
2975
- PathBuf :: from ( & * tool) ,
2976
+ PathBuf :: from ( tool) ,
2976
2977
Self :: rustc_wrapper_fallback ( ) ,
2977
2978
Vec :: new ( ) ,
2978
2979
) ) ;
You can’t perform that action at this time.
0 commit comments