summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index f41196093c..10a1813d07 100644
--- a/ruby.c
+++ b/ruby.c
@@ -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: