diff options
author | Patrik Nyblom <[email protected]> | 2013-01-29 17:28:20 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-02-11 14:11:37 +0100 |
commit | aa15249fe5d8819e511ca0f09eae1d1207903e53 (patch) | |
tree | fda2d2070eeebb19ba941fe70ce8ee753f279976 /erts/emulator/sys/common | |
parent | 066c26ec53012ccea106a4f27b85ddbdb58bb2bc (diff) | |
download | otp-aa15249fe5d8819e511ca0f09eae1d1207903e53.tar.gz otp-aa15249fe5d8819e511ca0f09eae1d1207903e53.tar.bz2 otp-aa15249fe5d8819e511ca0f09eae1d1207903e53.zip |
Make prim_file skip invalid filenames in unicode mode
The fix affects list_dir and read_link. Raw filenames are now
never produced, just consumed even if +fnu or +fna is used on
Linux etc.
This also adds the options to get error return or error handler
warning messages with +fn{u|a}{i|w|e} as an option to erl.
This is still not documented and there needs to be other versions
of read_dir and read_link to facilitate reading of all types
of filenames and links.
A check that we will not change to an invalid directory is also needed.
Diffstat (limited to 'erts/emulator/sys/common')
-rw-r--r-- | erts/emulator/sys/common/erl_sys_common_misc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/erts/emulator/sys/common/erl_sys_common_misc.c b/erts/emulator/sys/common/erl_sys_common_misc.c index 1bf5fa89f4..a0cd4cd10a 100644 --- a/erts/emulator/sys/common/erl_sys_common_misc.c +++ b/erts/emulator/sys/common/erl_sys_common_misc.c @@ -47,14 +47,16 @@ /* Written once and only once */ static int filename_encoding = ERL_FILENAME_UNKNOWN; +static int filename_warning = ERL_FILENAME_WARNING_WARNING; #if defined(__WIN32__) || defined(__DARWIN__) static int user_filename_encoding = ERL_FILENAME_UTF8; /* Default unicode on windows */ #else static int user_filename_encoding = ERL_FILENAME_LATIN1; #endif -void erts_set_user_requested_filename_encoding(int encoding) +void erts_set_user_requested_filename_encoding(int encoding, int warning) { user_filename_encoding = encoding; + filename_warning = warning; } int erts_get_user_requested_filename_encoding(void) @@ -62,6 +64,11 @@ int erts_get_user_requested_filename_encoding(void) return user_filename_encoding; } +int erts_get_filename_warning_type(void) +{ + return filename_warning; +} + void erts_init_sys_common_misc(void) { #if defined(__WIN32__) |