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 | 68c46aadb8c2c292e230d9c76690feec40899b97 (patch) | |
tree | 647a1accfdacdbd58d0acd86c8321a42f69ec65e /ruby.c | |
parent | d2c9d4b57e4524cae789699660f6ef87e8759c0c (diff) |
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -678,9 +678,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: |