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

ruby-changes:41298

From: nobu <ko1@a...>
Date: Tue, 29 Dec 2015 19:40:00 +0900 (JST)
Subject: [ruby-changes:41298] nobu:r53370 (trunk): ruby.c: parse -W option

nobu	2015-12-29 19:39:53 +0900 (Tue, 29 Dec 2015)

  New Revision: 53370

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

  Log:
    ruby.c: parse -W option
    
    * ruby.c (proc_options): parse and skip '-W' option and its
      argument even if ignored.

  Modified files:
    trunk/ruby.c
Index: ruby.c
===================================================================
--- ruby.c	(revision 53369)
+++ ruby.c	(revision 53370)
@@ -888,28 +888,30 @@ proc_options(long argc, char **argv, str https://github.com/ruby/ruby/blob/trunk/ruby.c#L888
 	    goto reswitch;
 
 	  case 'W':
-	    if (!opt->warning) {
+	    {
 		size_t numlen;
 		int v = 2;	/* -W as -W2 */
 
-		opt->warning = 1;
 		if (*++s) {
 		    v = scan_oct(s, 1, &numlen);
 		    if (numlen == 0)
 			v = 1;
 		    s += numlen;
 		}
-		switch (v) {
-		  case 0:
-		    ruby_verbose = Qnil;
-		    break;
-		  case 1:
-		    ruby_verbose = Qfalse;
-		    break;
-		  default:
-		    ruby_verbose = Qtrue;
-		    break;
+		if (!opt->warning) {
+		    switch (v) {
+		      case 0:
+			ruby_verbose = Qnil;
+			break;
+		      case 1:
+			ruby_verbose = Qfalse;
+			break;
+		      default:
+			ruby_verbose = Qtrue;
+			break;
+		    }
 		}
+		opt->warning = 1;
 	    }
 	    goto reswitch;
 

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

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