Browse Source

* WASI: workaround for FindFirst/FindNext opening the current directory, by using its full name

Nikolay Nikolov 5 months ago
parent
commit
7e89495a09
1 changed files with 3 additions and 0 deletions
  1. 3 0
      rtl/wasi/wasiutil.pp

+ 3 - 0
rtl/wasi/wasiutil.pp

@@ -294,6 +294,9 @@ Begin
          DirName:=Copy(f.SearchSpec,1,f.NamePos);
         if ConvertToFdRelativePath(DirName,fd,pr)=0 then
          begin
+           { WasmTime doesn't like opening an empty path }
+           if pr='' then
+             pr:='.';
            repeat
              res:=__wasi_path_open(fd,
                                    0,