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

ruby-changes:37398

From: nobu <ko1@a...>
Date: Tue, 3 Feb 2015 15:15:57 +0900 (JST)
Subject: [ruby-changes:37398] nobu:r49479 (trunk): remove duplication in warning

nobu	2015-02-03 15:15:51 +0900 (Tue, 03 Feb 2015)

  New Revision: 49479

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

  Log:
    remove duplication in warning
    
    * dir.c (sys_warning_1): remove duplication in the message.
    * error.c (rb_mod_sys_fail_str): ditto.

  Modified files:
    trunk/dir.c
    trunk/error.c
Index: dir.c
===================================================================
--- dir.c	(revision 49478)
+++ dir.c	(revision 49479)
@@ -1081,7 +1081,7 @@ dir_s_rmdir(VALUE obj, VALUE dir) https://github.com/ruby/ruby/blob/trunk/dir.c#L1081
 static VALUE
 sys_warning_1(VALUE mesg)
 {
-    rb_sys_warning("%s:%s", strerror(errno), (const char *)mesg);
+    rb_sys_warning("%s", (const char *)mesg);
     return Qnil;
 }
 
Index: error.c
===================================================================
--- error.c	(revision 49478)
+++ error.c	(revision 49479)
@@ -2096,7 +2096,6 @@ rb_sys_warning(const char *fmt, ...) https://github.com/ruby/ruby/blob/trunk/error.c#L2096
 
     if (!RTEST(ruby_verbose)) return;
 
-    snprintf(buf, BUFSIZ, "warning: %s", fmt);
     snprintf(buf+strlen(buf), BUFSIZ-strlen(buf), ": %s", strerror(errno_save));
 
     va_start(args, fmt);

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

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