File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ impl FileSystem for FileSystemOs {
172172 }
173173 } else if #[ cfg( windows) ] {
174174 dunce:: canonicalize( path)
175- } else {
175+ } else if # [ cfg ( target_family = "wasm" ) ] {
176176 use std:: path:: Component ;
177177 let mut path_buf = path. to_path_buf( ) ;
178178 loop {
@@ -184,15 +184,8 @@ impl FileSystem for FileSystemOs {
184184 path_buf. pop( ) ;
185185 }
186186 Component :: Normal ( seg) => {
187- #[ cfg( target_family = "wasm" ) ]
188187 // Need to trim the extra \0 introduces by https://github.com/nodejs/uvwasi/issues/262
189- {
190- path_buf. push( seg. to_string_lossy( ) . trim_end_matches( '\0' ) ) ;
191- }
192- #[ cfg( not( target_family = "wasm" ) ) ]
193- {
194- path_buf. push( seg) ;
195- }
188+ path_buf. push( seg. to_string_lossy( ) . trim_end_matches( '\0' ) ) ;
196189 }
197190 Component :: RootDir => {
198191 path_buf = PathBuf :: from( "/" ) ;
@@ -205,6 +198,8 @@ impl FileSystem for FileSystemOs {
205198 }
206199 }
207200 Ok ( path_buf)
201+ } else {
202+ fs:: canonicalize( path)
208203 }
209204 }
210205 }
You can’t perform that action at this time.
0 commit comments