summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-25 07:32:58 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-25 07:32:58 +0000
commitf6001be537623a52513919ee1890b2bbccc119f0 (patch)
tree83ae23687b8251df5ecb44e821db8c5f4d5746d9
parent708e5ddde62fc424a40f61f8c73b6909e33f6da3 (diff)
* ruby.c (proc_options): checks if the word is empty.
* ruby.c (process_options): typo fixed. [ruby-dev:34122] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ruby.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 15fc2e527f..d20cd2b0fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Mar 25 16:32:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (proc_options): checks if the word is empty.
+
+ * ruby.c (process_options): typo fixed. [ruby-dev:34122]
+
Tue Mar 25 15:26:30 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* compile.c (defined_expr): false short-circuit destination label may
diff --git a/ruby.c b/ruby.c
index 7e505ad11d..075c3d057a 100644
--- a/ruby.c
+++ b/ruby.c
@@ -842,14 +842,14 @@ proc_options(int argc, char **argv, struct cmdline_options *opt)
}
else if (strncmp("enable", s, n = 6) == 0 &&
(!s[n] || s[n] == '-' || s[n] == '=')) {
- if (!(s += n + 1)[-1] && (!--argc || !(s = *++argv))) {
+ if ((s += n + 1)[-1] ? !*s : (!--argc || !(s = *++argv))) {
rb_raise(rb_eRuntimeError, "missing argument for --enable");
}
ruby_each_words(s, enable_option, &opt->disable);
}
else if (strncmp("disable", s, n = 7) == 0 &&
(!s[n] || s[n] == '-' || s[n] == '=')) {
- if (!(s += n + 1)[-1] && (!--argc || !(s = *++argv))) {
+ if ((s += n + 1)[-1] ? !*s : (!--argc || !(s = *++argv))) {
rb_raise(rb_eRuntimeError, "missing argument for --disable");
}
ruby_each_words(s, disable_option, &opt->disable);
@@ -1051,7 +1051,7 @@ process_options(VALUE arg)
process_sflag(opt);
ruby_init_loadpath();
- ruby_init_gems(!(opt->disable && DISABLE_BIT(gems)));
+ ruby_init_gems(!(opt->disable & DISABLE_BIT(gems)));
parser = rb_parser_new();
if (opt->yydebug) rb_parser_set_yydebug(parser, Qtrue);
if (opt->ext.enc.name != 0) {