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

ruby-changes:33937

From: nobu <ko1@a...>
Date: Mon, 19 May 2014 21:32:26 +0900 (JST)
Subject: [ruby-changes:33937] nobu:r46018 (trunk): etc.c: fix parameter

nobu	2014-05-19 21:32:14 +0900 (Mon, 19 May 2014)

  New Revision: 46018

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

  Log:
    etc.c: fix parameter
    
    * ext/etc/etc.c (etc_uname): call with same first parameters.

  Modified files:
    trunk/ext/etc/etc.c
Index: ext/etc/etc.c
===================================================================
--- ext/etc/etc.c	(revision 46017)
+++ ext/etc/etc.c	(revision 46018)
@@ -702,9 +702,10 @@ etc_uname(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L702
 			 rb_w32_conv_from_wchar(v.szCSDVersion, rb_utf8_encoding()));
     rb_hash_aset(result, ID2SYM(rb_intern("version")), version);
 
-    GetComputerNameExW(ComputerNameDnsFullyQualified, NULL, &len);
+#   define GET_COMPUTER_NAME(ptr, plen) GetComputerNameExW(ComputerNameDnsFullyQualified, ptr, len);
+    GET_COMPUTER_NAME(NULL, &len);
     buf = ALLOCV_N(WCHAR, vbuf, len);
-    if (GetComputerNameExW(ComputerNameDnsHostname, buf, &len)) {
+    if (GET_COMPUTER_NAME(buf, &len)) {
 	nodename = rb_w32_conv_from_wchar(buf, rb_utf8_encoding());
     }
     ALLOCV_END(vbuf);

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

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