aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pack.c4
-rw-r--r--test/ruby/test_pack.rb3
2 files changed, 3 insertions, 4 deletions
diff --git a/pack.c b/pack.c
index 5b63c3f242..0ced420bd9 100644
--- a/pack.c
+++ b/pack.c
@@ -2004,8 +2004,8 @@ pack_unpack(VALUE str, VALUE fmt)
while (s < send) {
if (*s == '=') {
if (++s == send) break;
- if (s+1 < send && *s == '\r' && *(s+1) == '\n')
- s++;
+ if (s+1 < send && *s == '\r' && *(s+1) == '\n')
+ s++;
if (*s != '\n') {
if ((c1 = hex2num(*s)) == -1) break;
if (++s == send) break;
diff --git a/test/ruby/test_pack.rb b/test/ruby/test_pack.rb
index 3f383afa2a..5a19cb3d56 100644
--- a/test/ruby/test_pack.rb
+++ b/test/ruby/test_pack.rb
@@ -572,8 +572,7 @@ EXPECTED
assert_equal(["a"*1023], (("a"*73+"=\n")*14+"a=\n").unpack("M"))
assert_equal(["\x0a"], "=0a=\n".unpack("M"))
assert_equal(["\x0a"], "=0A=\n".unpack("M"))
- assert_equal([""], "=0Z=\n".unpack("M"))
- assert_equal([""], "=\r\n".unpack("M"))
+ assert_equal(["=0Z=\n"], "=0Z=\n".unpack("M"))
assert_equal([""], "=\r\n".unpack("M"))
assert_equal(["\xC6\xF7"], "=C6=F7".unpack('M*'))