[PHP-dev 827]Re: FYI:mbstring+鬼車 参考実装

Seiji Masugata s.masugata @ digicom.dnp.co.jp
2003年 7月 28日 (月) 10:31:13 JST


こんにちわ、桝形です。

遅ればせながら、下記パッチを試してみました。

試したアーカイブは以下の通りです。

php4-STABLE-200307272330.tar.gz
php-4.3.3RC1.tar.gz

とりあえず、config.m4は全く当たっていなかったので、パッチの
内容をみて、丸々取り替えました。

mbstring.cは、コメントの部分が当たっていなかっただけなので
無視しました。

で、php_mbregex.cで、

 /* {{{ static void php_mb_regex_free_cache() */
-static void php_mb_regex_free_cache(mb_regex_t *pre) 
+static void php_mb_regex_free_cache(php_mb_regex_t **pre) 
 {
-	mbre_free_pattern(pre);
+	php_mb_regex_free(*pre);
 }
 /* }}} */


 /* {{{ _php_mb_regex_globals_ctor */
 void _php_mb_regex_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC)
 {
-	MBSTRG(default_mbctype) = MBCTYPE_EUC;
-	MBSTRG(current_mbctype) = MBCTYPE_EUC;
+	MBSTRG(default_mbctype) = REGCODE_EUCJP;
+	MBSTRG(current_mbctype) = REGCODE_EUCJP;

以下続く。。。

と、ありますが、元々、テストしたアーカイブには存在しないように
思えます。

大体当たらなかったのは、対象がないから。。。って感じに思えました。
( php_mbregex.c/php_mbregex.h共に )

やっぱり、CVSから直接アーカイブを引っ張ってこないと駄目ですか?

で、結局、ちゃんとパッチが当たっていないので、( 特にmbstring.cと
php_mbregex.cは重要そう )動作の確認までは行っていません。

$ gunzip -c ../php-mbstring-oniguruma-patch-20030704.diff.gz | patch -p0
patching file `ext/mbstring/config.m4'
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to ext/mbstring/config.m4.rej
patching file `ext/mbstring/mbstring.c'
Hunk #1 FAILED at 17.
Hunk #2 succeeded at 74 (offset -3 lines).
Hunk #3 succeeded at 186 with fuzz 1 (offset 15 lines).
Hunk #4 succeeded at 590 (offset 48 lines).
1 out of 4 hunks FAILED -- saving rejects to ext/mbstring/mbstring.c.rej
patching file `ext/mbstring/oniguruma/.cvsignore'
patching file `ext/mbstring/oniguruma/COPYING'
patching file `ext/mbstring/oniguruma/HISTORY'
patching file `ext/mbstring/oniguruma/INSTALL-RUBY'
patching file `ext/mbstring/oniguruma/Makefile.in'
patching file `ext/mbstring/oniguruma/README'
patching file `ext/mbstring/oniguruma/config.h'
patching file `ext/mbstring/oniguruma/config.h.in'
patching file `ext/mbstring/oniguruma/configure.in'
patching file `ext/mbstring/oniguruma/doc/API'
patching file `ext/mbstring/oniguruma/doc/RE'
patching file `ext/mbstring/oniguruma/onigposix.h'
patching file `ext/mbstring/oniguruma/oniguruma.h'
patching file `ext/mbstring/oniguruma/php_compat.h'
patching file `ext/mbstring/oniguruma/re.c.168.patch'
patching file `ext/mbstring/oniguruma/re.c.180.patch'
patching file `ext/mbstring/oniguruma/regcomp.c'
patching file `ext/mbstring/oniguruma/regcomp.lo'
patching file `ext/mbstring/oniguruma/regerror.c'
patching file `ext/mbstring/oniguruma/regerror.lo'
patching file `ext/mbstring/oniguruma/regex.c'
patching file `ext/mbstring/oniguruma/regexec.c'
patching file `ext/mbstring/oniguruma/regexec.lo'
patching file `ext/mbstring/oniguruma/reggnu.c'
patching file `ext/mbstring/oniguruma/reggnu.lo'
patching file `ext/mbstring/oniguruma/regint.h'
patching file `ext/mbstring/oniguruma/regparse.c'
patching file `ext/mbstring/oniguruma/regparse.h'
patching file `ext/mbstring/oniguruma/regparse.lo'
patching file `ext/mbstring/oniguruma/regposerr.c'
patching file `ext/mbstring/oniguruma/regposerr.lo'
patching file `ext/mbstring/oniguruma/regposix.c'
patching file `ext/mbstring/oniguruma/sample/names.c'
patching file `ext/mbstring/oniguruma/sample/posix.c'
patching file `ext/mbstring/oniguruma/sample/simple.c'
patching file `ext/mbstring/oniguruma/test.rb'
patching file `ext/mbstring/oniguruma/testconv.rb'
patching file `ext/mbstring/oniguruma/win32/Makefile'
patching file `ext/mbstring/oniguruma/win32/config.h'
patching file `ext/mbstring/oniguruma/win32/testc.c'
patching file `ext/mbstring/php_mbregex.c'
Hunk #1 FAILED at 25.
Hunk #2 FAILED at 92.
Hunk #3 FAILED at 100.
Hunk #4 FAILED at 123.
Hunk #5 succeeded at 128 (offset -87 lines).
Hunk #7 succeeded at 151 (offset -87 lines).
Hunk #9 succeeded at 185 (offset -87 lines).
Hunk #11 succeeded at 268 (offset -87 lines).
Hunk #13 succeeded at 294 (offset -87 lines).
Hunk #15 succeeded at 329 (offset -87 lines).
Hunk #17 succeeded at 406 (offset -87 lines).
Hunk #18 FAILED at 421.
Hunk #19 succeeded at 518 (offset -11 lines).
Hunk #20 succeeded at 460 with fuzz 2 (offset -87 lines).
Hunk #21 FAILED at 504.
Hunk #22 succeeded at 594 (offset -12 lines).
Hunk #23 succeeded at 573 (offset -87 lines).
Hunk #24 FAILED at 601.
Hunk #25 succeeded at 744 (offset -10 lines).
Hunk #26 succeeded at 683 (offset -87 lines).
Hunk #27 succeeded at 780 (offset -10 lines).
Hunk #28 succeeded at 886 (offset 71 lines).
Hunk #29 succeeded at 814 with fuzz 1 (offset -10 lines).
Hunk #30 FAILED at 826.
Hunk #31 FAILED at 893.
Hunk #32 FAILED at 907.
Hunk #33 FAILED at 915.
Hunk #34 FAILED at 923.
Hunk #35 FAILED at 949.
Hunk #36 FAILED at 958.
Hunk #37 succeeded at 944 (offset -81 lines).
Hunk #38 succeeded at 1023 (offset -10 lines).
Hunk #39 succeeded at 964 (offset -81 lines).
Hunk #40 succeeded at 1047 (offset -10 lines).
Hunk #41 succeeded at 993 (offset -81 lines).
14 out of 41 hunks FAILED -- saving rejects to ext/mbstring/php_mbregex.c.rej
patching file `ext/mbstring/php_mbregex.h'
Hunk #1 succeeded at 25 with fuzz 1.
Hunk #2 FAILED at 78.
1 out of 2 hunks FAILED -- saving rejects to ext/mbstring/php_mbregex.h.rej

> 前回は面倒くさかったのでアホみたいなアーカイブでしたが、
> 今回は差分だけにしてみました。従って、PHP_4_3 ブランチにも
> 試してませんがそのまま適用できるかもしれません。
> 
> http://www.voltex.jp/patches/php-mbstring-oniguruma-patch-20030704.diff.gz
> 
> 手順は
> 
> 1.
> cd php-src (php5 ブランチ)
> 
> 2.
> wget -O - \ http://www.voltex.jp/patches/php-mbstring-oniguruma-patch-20030704.diff.gz \
> | gunzip -c | patch -p0
> 
> なり、
> 
> curl \
> http://www.voltex.jp/patches/php-mbstring-oniguruma-patch-20030704.diff.gz \
> | gunzip -c | patch -p0
> 
> なり、
> 
> w3m -dump_source \
> http://www.voltex.jp/patches/php-mbstring-oniguruma-patch-20030704.diff.gz \
> | gunzip -c | patch -p0
> 
> お好みの方法で。
> 
> 3.
> ./buildconf
> (例によって autoconf / automake / libtool が必要です。)
> 
> 4.
> ./configure
> 
> 以上です。
> また動かなかったら教えてください。
> 
> Rui Hirokawa <rui_hirokawa @ ybb.ne.jp> wrote:
> 
> > 
> > 廣川です。
> > 
> > ext/mbstring/tests/mb_ereg.phptでテストしましたが、
> > php-srcのHEADで動作しました。
> > また、PHP-4.3.xでも若干の変更(添付)でとりあえず動作しました。
> > 
> > ただし、xt/mbstring/tests/mb_ereg.phptの
> > 先頭行のmb_regex_set_options( '' );をコメントアウトしないと
> > 正常に動作しないようです。

--
Seiji Masugata<s.masugata @ digicom.dnp.co.jp>



PHP-dev メーリングリストの案内