summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-20 08:21:41 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-20 08:21:41 +0000
commit8852d54df49dd08207748ea537f23710add98c97 (patch)
treeb5b47d883790531624ab8e898673af038c7a40e4 /string.c
parent4b3d078462f3d9306e56649bd818e0f54c214f18 (diff)
to open CVS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/string.c b/string.c
index 4d7928f..43d6033 100644
--- a/string.c
+++ b/string.c
@@ -1404,7 +1404,7 @@ rb_str_dump(str)
switch (c) {
case '"': case '\\':
case '\n': case '\r':
- case '\t': case '\f':
+ case '\t': case '\f': case '#':
case '\013': case '\007': case '\033':
len += 2;
break;
@@ -1432,6 +1432,10 @@ rb_str_dump(str)
*q++ = '\\';
*q++ = c;
}
+ else if (c == '#') {
+ *q++ = '\\';
+ *q++ = '#';
+ }
else if (ISPRINT(c)) {
*q++ = c;
}