aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2013-02-11 12:48:08 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2013-02-11 14:12:54 +0100
commita8a8d27a461e82af3f88774e07906a920f95e63e (patch)
tree5795e0487849030ea3739fd520f0b8d2af01af64 /erts/emulator/beam/bif.tab
parentaa15249fe5d8819e511ca0f09eae1d1207903e53 (diff)
downloadotp-a8a8d27a461e82af3f88774e07906a920f95e63e.tar.gz
otp-a8a8d27a461e82af3f88774e07906a920f95e63e.tar.bz2
otp-a8a8d27a461e82af3f88774e07906a920f95e63e.zip
Teach prim_file:set_cwd() to avoid entering non-translatable directories
We have decided that we don't want to deal with the compilations of prim_file:get_cwd() returning a binary when the current directory name cannot be translated losslessly to a list (i.e. when the run-time system was started with +fnu and the current directory name contains bytes that are not part of a valid UTF-8 sequence). Therefore, if prim_file:set_cwd() is given a binary as the pathname, we will need to check the binary to make sure it can be translated to a list. We will introduce a new BIF, called prim_file:is_translatable/1, which will check both filename encoding mode, and if it is one of Unicode modes, the binary as well. We don't need to do anything special if prim_file:set_cwd() is passed a list.
Diffstat (limited to 'erts/emulator/beam/bif.tab')
-rw-r--r--erts/emulator/beam/bif.tab1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab
index 4aaf466008..e313188901 100644
--- a/erts/emulator/beam/bif.tab
+++ b/erts/emulator/beam/bif.tab
@@ -522,6 +522,7 @@ bif erlang:nif_error/2
bif prim_file:internal_name2native/1
bif prim_file:internal_native2name/1
bif prim_file:internal_normalize_utf8/1
+bif prim_file:is_translatable/1
bif file:native_name_encoding/0
#