ruby-changes:54188
From: k0kubun <ko1@a...>
Date: Sat, 15 Dec 2018 23:45:40 +0900 (JST)
Subject: [ruby-changes:54188] k0kubun:r66409 (trunk): Revert "* expand tabs."
k0kubun 2018-12-15 23:45:36 +0900 (Sat, 15 Dec 2018) New Revision: 66409 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66409 Log: Revert "* expand tabs." This reverts commit 298180f0450df6e975057cc7e90b3ae3248586fc. It looks like we should not expand ext/nkf: https://git.ruby-lang.org/ruby-commit-hook.git/commit/?id=91fd9708b7cf04a4dcddd9614c24e27ddef5d43b Modified files: trunk/ext/nkf/nkf-utf8/nkf.c Index: ext/nkf/nkf-utf8/nkf.c =================================================================== --- ext/nkf/nkf-utf8/nkf.c (revision 66408) +++ ext/nkf/nkf-utf8/nkf.c (revision 66409) @@ -1113,23 +1113,23 @@ encode_fallback_java(nkf_char c) https://github.com/ruby/ruby/blob/trunk/ext/nkf/nkf-utf8/nkf.c#L1113 if(!nkf_char_unicode_bmp_p(c)){ int high = (c >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */ int low = (c & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */ - (*oconv)(0, 'u'); - (*oconv)(0, bin2hex(high>>12)); - (*oconv)(0, bin2hex(high>> 8)); - (*oconv)(0, bin2hex(high>> 4)); - (*oconv)(0, bin2hex(high )); - (*oconv)(0, '\\'); - (*oconv)(0, 'u'); - (*oconv)(0, bin2hex(low>>12)); - (*oconv)(0, bin2hex(low>> 8)); - (*oconv)(0, bin2hex(low>> 4)); - (*oconv)(0, bin2hex(low )); + (*oconv)(0, 'u'); + (*oconv)(0, bin2hex(high>>12)); + (*oconv)(0, bin2hex(high>> 8)); + (*oconv)(0, bin2hex(high>> 4)); + (*oconv)(0, bin2hex(high )); + (*oconv)(0, '\\'); + (*oconv)(0, 'u'); + (*oconv)(0, bin2hex(low>>12)); + (*oconv)(0, bin2hex(low>> 8)); + (*oconv)(0, bin2hex(low>> 4)); + (*oconv)(0, bin2hex(low )); }else{ (*oconv)(0, 'u'); - (*oconv)(0, bin2hex(c>>12)); - (*oconv)(0, bin2hex(c>> 8)); - (*oconv)(0, bin2hex(c>> 4)); - (*oconv)(0, bin2hex(c )); + (*oconv)(0, bin2hex(c>>12)); + (*oconv)(0, bin2hex(c>> 8)); + (*oconv)(0, bin2hex(c>> 4)); + (*oconv)(0, bin2hex(c )); } return; } @@ -1956,17 +1956,17 @@ unicode_to_jis_common(nkf_char c2, nkf_c https://github.com/ruby/ruby/blob/trunk/ext/nkf/nkf-utf8/nkf.c#L1956 }else return -1; #ifdef SHIFTJIS_CP932 if (!ret&& is_eucg3(*p2)) { - if (cp932inv_f) { - if (encode_fallback) ret = 1; + if (cp932inv_f) { + if (encode_fallback) ret = 1; + } + else { + nkf_char s2, s1; + if (e2s_conv(*p2, *p1, &s2, &s1) == 0) { + s2e_conv(s2, s1, p2, p1); + }else{ + ret = 1; + } } - else { - nkf_char s2, s1; - if (e2s_conv(*p2, *p1, &s2, &s1) == 0) { - s2e_conv(s2, s1, p2, p1); - }else{ - ret = 1; - } - } } #endif return ret; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/