[前][次][番号順一覧][スレッド一覧]

ruby-changes:11044

From: usa <ko1@a...>
Date: Thu, 26 Feb 2009 10:58:32 +0900 (JST)
Subject: [ruby-changes:11044] Ruby:r22637 (trunk): * include/ruby/win32.h (rb_w32_wopen): prototype forgotten.

usa	2009-02-26 10:58:20 +0900 (Thu, 26 Feb 2009)

  New Revision: 22637

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22637

  Log:
    * include/ruby/win32.h (rb_w32_wopen): prototype forgotten.
    * io.c (rb_sysopen_internal): shouldn't replace undefined chars in this
      case.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/win32.h
    trunk/io.c

Index: include/ruby/win32.h
===================================================================
--- include/ruby/win32.h	(revision 22636)
+++ include/ruby/win32.h	(revision 22637)
@@ -532,6 +532,7 @@
 int  rb_w32_sleep(unsigned long msec);
 int  rb_w32_putc(int, FILE*);
 int  rb_w32_getc(FILE*);
+int  rb_w32_wopen(const WCHAR *, int, ...);
 int  rb_w32_open(const char *, int, ...);
 int  rb_w32_close(int);
 int  rb_w32_fclose(FILE*);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22636)
+++ ChangeLog	(revision 22637)
@@ -1,3 +1,10 @@
+Thu Feb 26 10:56:48 2009  NAKAMURA Usaku  <usa@r...>
+
+	* include/ruby/win32.h (rb_w32_wopen): prototype forgotten.
+
+	* io.c (rb_sysopen_internal): shouldn't replace undefined chars in this
+	  case.
+
 Thu Feb 26 01:34:38 2009  Tanaka Akira  <akr@f...>
 
 	* ext/socket/mkconstants.rb: more MSG_* constants.
Index: io.c
===================================================================
--- io.c	(revision 22636)
+++ io.c	(revision 22637)
@@ -4185,7 +4185,8 @@
     struct sysopen_struct *data = ptr;
 #ifdef _WIN32
     if (data->wchar)
-	return (VALUE)rb_w32_wopen(data->fname, data->oflags, data->perm);
+	return (VALUE)rb_w32_wopen((WCHAR *)data->fname, data->oflags,
+				   data->perm);
 #endif
     return (VALUE)open(data->fname, data->oflags, data->perm);
 }
@@ -4207,15 +4208,8 @@
 	    utf16 = NULL;
     }
     if (utf16) {
-	VALUE wfname;
-	VALUE opthash = rb_hash_new();
-	int ecflags;
-	VALUE ecopts;
-	rb_hash_aset(opthash, ID2SYM(rb_intern("undef")),
-		     ID2SYM(rb_intern("replace")));
-	ecflags = rb_econv_prepare_opts(opthash, &ecopts);
-	wfname = rb_str_encode(fname, rb_enc_from_encoding(utf16), ecflags,
-			       ecopts);
+	VALUE wfname = rb_str_encode(fname, rb_enc_from_encoding(utf16), 0,
+				     Qnil);
 	rb_enc_str_buf_cat(wfname, "", 1, utf16); /* workaround */
 	data.fname = RSTRING_PTR(wfname);
 	data.wchar = 1;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]