-
Notifications
You must be signed in to change notification settings - Fork 195
Closed
Labels
Description
Describe the bug
In the pseudo filesystem, ..
for a child directory of the root points to itself instead of the root.
Is this the intended behavior?
Note that this issue does not occur for deeper directories.
open Js_of_ocaml
let () =
Sys_js.create_file ~name:"/foo/bar/baz" ~content:"";
Sys.readdir "/foo/.."
|> Array.to_list
|> String.concat ","
|> print_endline; (* Expected foo, but got bar *)
Sys.readdir "/foo/bar/.."
|> Array.to_list
|> String.concat ","
|> print_endline; (* bar *)
Expected behavior
/foo/..
may have to point to /
.
Checking the source code, I found the following line:
Line 97 in d7a323b
if (ncomp.length > 1) ncomp.pop(); |
ncomp.length >= 1
may be correct instead of ncomp.length > 1
.
Versions
$ js_of_ocaml --version
6.0.1
$ ocamlc -version
5.3.0