aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 00:18:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 00:18:30 +0000
commit2e0e39c6dd28d584dfd3814d2bda021119f32602 (patch)
treea19db9cc24e2103e07d5cc2f58a781108c7bc204 /dir.c
parent56cecc6025c468c66c12e4a1172060c36f695df5 (diff)
downloadruby-2e0e39c6dd28d584dfd3814d2bda021119f32602.tar.gz
win32.c: rb_dir_getwd_ospath
* win32/win32.c (rb_dir_getwd_ospath): Windows implementation moved from dir.c. get rid of freeing malloced memory by xfree. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index 3f25bc576d..3db196fef9 100644
--- a/dir.c
+++ b/dir.c
@@ -1081,6 +1081,7 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
return INT2FIX(0);
}
+#ifndef _WIN32
VALUE
rb_dir_getwd_ospath(void)
{
@@ -1093,10 +1094,7 @@ rb_dir_getwd_ospath(void)
path_guard = Data_Wrap_Struct((VALUE)0, NULL, RUBY_DEFAULT_FREE, NULL);
path = my_getcwd();
DATA_PTR(path_guard) = path;
-#ifdef _WIN32
- cwd = rb_utf8_str_new_cstr(path);
- OBJ_TAINT(cwd);
-#elif defined __APPLE__
+#ifdef __APPLE__
cwd = rb_str_normalize_ospath(path, strlen(path));
OBJ_TAINT(cwd);
#else
@@ -1107,6 +1105,7 @@ rb_dir_getwd_ospath(void)
xfree(path);
return cwd;
}
+#endif
VALUE
rb_dir_getwd(void)