aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-11-09 18:08:57 +0100
committerPatrik Nyblom <[email protected]>2010-11-30 16:32:29 +0100
commit9622ab2132e2501ee5769357a914dcc6635e515c (patch)
tree77a4f13c833d325025e6bd7cb614798727828402 /erts/emulator/sys
parent4161de166d46b6c9c25d5ac813c94a025c7a029d (diff)
downloadotp-9622ab2132e2501ee5769357a914dcc6635e515c.tar.gz
otp-9622ab2132e2501ee5769357a914dcc6635e515c.tar.bz2
otp-9622ab2132e2501ee5769357a914dcc6635e515c.zip
Convert filenames read on MacOSX to canonical form
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r--erts/emulator/sys/common/erl_sys_common_misc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/erts/emulator/sys/common/erl_sys_common_misc.c b/erts/emulator/sys/common/erl_sys_common_misc.c
index 7338ffc963..461e763f03 100644
--- a/erts/emulator/sys/common/erl_sys_common_misc.c
+++ b/erts/emulator/sys/common/erl_sys_common_misc.c
@@ -17,10 +17,11 @@
* %CopyrightEnd%
*/
+
+
/*
- * Description: Check I/O
- *
- * Author: Rickard Green
+ * Darwin needs conversion!
+ * http://developer.apple.com/library/mac/#qa/qa2001/qa1235.html
*/
#ifdef HAVE_CONFIG_H
@@ -30,6 +31,10 @@
#include "sys.h"
#include "global.h"
+#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__)
+#define __DARWIN__ 1
+#endif
+
#if !defined(__WIN32__)
#include <locale.h>
#if !defined(HAVE_SETLOCALE) || !defined(HAVE_NL_LANGINFO) || !defined(HAVE_LANGINFO_H)
@@ -42,7 +47,7 @@
/* Written once and only once */
static int filename_encoding = ERL_FILENAME_UNKNOWN;
-#if defined(__WIN32__)
+#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;
@@ -88,6 +93,11 @@ void erts_init_sys_common_misc(void)
}
# endif
}
+# if defined(__DARWIN__)
+ if (filename_encoding == ERL_FILENAME_UTF8) {
+ filename_encoding = ERL_FILENAME_UTF8_MAC;
+ }
+# endif
#endif
}