summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-18 09:52:48 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-18 09:52:48 +0000
commit7de72c4858a8240ae025aecb3599291f0bf90e34 (patch)
tree441e714bdb81d7dc466279d4b7306158a5043a7f /pack.c
parent3432cecf246414d63d55e70aeb5697e62198618f (diff)
* parse.y (expr_value, arg_value, primary_value): value_expr()
check in place. * eval.c (block_pass): "&nil" should clear block given. * dir.c (push_braces): remove MAXPATHLEN dependency. * dir.c (dir_s_globd): ditto. * dln.c (init_funcname): ditto. * dln.c (load_1): ditto. * dln.c (dln_load): ditto. * configure.in: add GNU/Hurd switches. * pack.c (pack_pack): allows comment in template strings. * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/pack.c b/pack.c
index 316bece..0023765 100644
--- a/pack.c
+++ b/pack.c
@@ -363,6 +363,13 @@ pack_pack(ary, fmt)
#endif
if (ISSPACE(type)) continue;
+ if (type == '#') {
+ while (p < pend) {
+ if (*p == '\n') continue;
+ p++;
+ }
+ break;
+ }
if (*p == '_' || *p == '!') {
char *natstr = "sSiIlL";
@@ -1070,11 +1077,20 @@ pack_unpack(str, fmt)
ary = rb_ary_new();
while (p < pend) {
+ type = *p++;
#ifdef NATINT_PACK
natint = 0;
#endif
+
+ if (ISSPACE(type)) continue;
+ if (type == '#') {
+ while (p < pend) {
+ if (*p == '\n') continue;
+ p++;
+ }
+ break;
+ }
star = 0;
- type = *p++;
if (*p == '_' || *p == '!') {
char *natstr = "sSiIlL";