summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
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 316becea40..00237659de 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";