diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-15 05:58:02 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-01-15 05:58:02 +0000 |
| commit | e12785889e2038a0d7e3206a2c1ba237ad4129f2 (patch) | |
| tree | 55ba06a156fddf8d07ddec7a4c7cb0fee60dbd1f | |
| parent | bcf877d103b18855e52eb28ac307922fd1bf9fbc (diff) | |
| download | ruby-e12785889e2038a0d7e3206a2c1ba237ad4129f2.tar.gz ruby-e12785889e2038a0d7e3206a2c1ba237ad4129f2.tar.xz ruby-e12785889e2038a0d7e3206a2c1ba237ad4129f2.zip | |
* ruby.c (proc_options): ignore trailing CRs at the end of short
options as well as long options. fixed: [ruby-core:04232]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | ruby.c | 15 |
2 files changed, 19 insertions, 3 deletions
@@ -1,7 +1,12 @@ +Sat Jan 15 14:57:22 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ruby.c (proc_options): ignore trailing CRs at the end of short + options as well as long options. fixed: [ruby-core:04232] + Sat Jan 15 13:44:22 2005 Kouhei Sutou <kou@cozmixng.org> * lib/rss/rss.rb (RSS::VERSION): 0.1.2 -> 0.1.3. - + * lib/rss/rss.rb: accept inheritance. [ruby-talk:126104] Wed Jan 12 00:36:29 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> @@ -683,9 +683,20 @@ proc_options(argc, argv) } break; + case '\r': + if (!s[1]) break; + default: - fprintf(stderr, "%s: invalid option -%c (-h will show valid options)\n", - origargv[0], *s); + { + const char *format; + if (ISPRINT(*s)) { + format = "%s: invalid option -%c (-h will show valid options)\n"; + } + else { + format = "%s: invalid option -\\%03o (-h will show valid options)\n"; + } + fprintf(stderr, format, origargv[0], (int)(unsigned char)*s); + } exit(2); case 0: |
