unpack("M")


#1

e$B$H$_$?$G$9!#e(B

e$B%P%0$+;EMM$+$O$o$+$i$J$$$s$G$9$,!"2~9T%3!<%I$,e(B CRLF e$B$N;~$Ke(B
unpack(“M”)
e$B$,$A$c$s$HF/$-$^$;$s!#e(B

% ruby -ve ‘puts “aaa=\nbbb”.unpack(“M”)’
ruby 1.8.4 (2005-12-24) [i686-linux]
aaabbb

% ruby -ve ‘puts “aaa=\r\nbbb”.unpack(“M”)’
ruby 1.8.4 (2005-12-24) [i686-linux]
aaa

unpack(“m”) e$B$Oe(B CRLF
e$B$G$bLdBj$J$$$N$GBP1~$7$?J}$,NI$$$H;W$&$N$G$9$,!"e(B
e$B$$$+$,$G$7$g$&$+!#e(B

— pack.c.orig 2005-10-13 23:30:49.000000000 +0900
+++ pack.c 2006-04-25 00:21:15.000000000 +0900
@@ -1834,6 +1834,8 @@
while (s < send) {
if (*s == ‘=’) {
if (++s == send) break;

  •                   if (s+1 < send && *s == '\r' && *(s+1) == '\n')
    
  •                     s++;
                      if (*s != '\n') {
                          if ((c1 = hex2num(*s)) == -1) break;
                          if (++s == send) break;

#2

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:28601] unpack(“M”)”
on Tue, 25 Apr 2006 00:26:00 +0900, e$B$H$_$?$^$5$R$me(B
removed_email_address@domain.invalid writes:

|e$B%P%0$+;EMM$+$O$o$+$i$J$$$s$G$9$,!"2~9T%3!<%I$,e(B CRLF e$B$N;~$Ke(B unpack(“M”)
|e$B$,$A$c$s$HF/$-$^$;$s!#e(B
|
|% ruby -ve ‘puts “aaa=\nbbb”.unpack(“M”)’
|ruby 1.8.4 (2005-12-24) [i686-linux]
|aaabbb
|
|% ruby -ve ‘puts “aaa=\r\nbbb”.unpack(“M”)’
|ruby 1.8.4 (2005-12-24) [i686-linux]
|aaa
|
|unpack(“m”) e$B$Oe(B CRLF e$B$G$bLdBj$J$$$N$GBP1~$7$?J}$,NI$$$H;W$&$N$G$9$,!"e(B
|e$B$$$+$,$G$7$g$&$+!#e(B

e$B%3%_%C%H$7$^$9!#e(B