diff -ruN grep-2.4.2.orig/README.mlb grep-2.4.2/README.mlb --- grep-2.4.2.orig/README.mlb Thu Jan 1 09:00:00 1970 +++ grep-2.4.2/README.mlb Tue Oct 31 17:09:24 2000 @@ -0,0 +1,34 @@ + grep-2.4.2+mb1.04a + ------------------ + +これは谷本(t^2)氏による grep-2.0 に対するマルチバイト文字対応パッチ +grep-2.0-mb1.04.diff を grep-2.4.2 に適用したものです。 + + ただし、grep-2.0-mb1.04.diff に含まれている DOS 版の対応部分は + 割愛させていただきました。 + +gawk-3.0.4+mb1.13 における岡部氏による修正を参考に次の不具合を修正して +います。 + + gawk-3.0.4+mb1.13 の ChangeLog.MB より引用: + + * dfa.c (lex): 文字クラスがマルチバイト文字+ハイフンで終了するとき, + 最後のマルチバイト文字がマッチングの対象になっていなかったのを修正. + 否定文字クラス中にマルチバイト文字の範囲指定があるとき必要以上の文字 + がマッチングの対象となっていたのを修正. (Thanks to 畑浩一さん + ) + + +grep-2.0-mb1.04.diff の詳細は、このパッケージに含まれる README.MB を +お読みください。 +grep-2.0-mb1.04.diff は例えば次の ftp サイトから入手できます。 + + ftp://ftp.win.ne.jp/pub/misc/grep-2.0-mb1.04.diff.gz + +元のパッチの対応バージョン 2.0 と現在のバージョン 2.4.2 は大きな差異が +あるため、パッチがうまく適用できていない可能性があります。 +もし何らかの、再現できるバグを発見なさった方は、御手数ですが、下記の +email アドレスまで御連絡いただけると幸いです。 + + linux@mlb.co.jp + Media Lab., Inc. diff -ruN grep-2.4.2.orig/ChangeLog.MB grep-2.4.2/ChangeLog.MB --- grep-2.4.2.orig/ChangeLog.MB Thu Jan 1 09:00:00 1970 +++ grep-2.4.2/ChangeLog.MB Fri Oct 13 23:28:46 2000 @@ -0,0 +1,219 @@ +Thu Jun 2 16:58:03 1994 Takahiro Tanimoto (tt@isaac) + + * Version 2.0 + multi-byte extension 1.04 released. + +Sat Mar 5 16:30:16 1994 Takahiro Tanimoto (tt@isaac) + + * README.MSC: PC-9800 シリーズ用 MS-C 6.00A の, ワイルドカード展 + 開ルーチンのバグに対処した. 以前の stdargv.diff をこれに統合し, + 削除した. (Thanks to 福浩邦さん ) + +Thu Aug 19 04:26:09 1993 Takahiro Tanimoto (tt@isaac) + + * regex.c (re_compile_fastmap): charset_not の fastmap の作成処 + 理が間違っていて, regex の fastmap を使用する場合 (e?grep では + fastmap を使用していないため, この問題は表面には現れない), 正規 + 表現の先頭の [^A] や [^a] に例えば B がマッチしなかった. + (Thanks to 小屋良祐さん ) + +Tue Aug 10 01:29:05 1993 Takahiro Tanimoto (tt@isaac) + + * regex.c (set_list_bits): 文字クラス中のマルチバイト文字の最適 + 化で, 区間終点の更新処理部分にバグがあり, [A-CE-GB-D] を最 + 適化すると [A-G] だが, これが [A-E] となってしまっていた. + ただし, regex ではなく dfa が使用される場合にはこのバグは表面に + は現れない. + +Fri Jul 23 03:22:13 1993 Takahiro Tanimoto (tt@isaac) + + * Version 2.0 + multi-byte extension 1.03 released. + + * DEFS.dos: strcmpi を stricmp に変更. + + * grep.c (main): MS-DOS の場合, argv[0] を加工した文字列へのポイ + ンタを argv[0] へもセットする. getopt が出力するメッセージも加 + 工された文字列となる. + + * grep.c (main): MS-C 6.00A の stdargv.asm のバグをフィックスし + たため, argv[0] == "" のときの処理を削除した. + + * stdargv.diff: 追加. + +Tue Jul 13 07:04:13 1993 Takahiro Tanimoto (tt@isaac) + + * Version 2.0 + multi-byte extension 1.02 released. + +Mon Jul 12 00:20:36 1993 Takahiro Tanimoto (tt@isaac) + + * grep.c: HAVE_STRCASECMP が #define されていないとき, 一方の文 + 字列だけを小文字にしてから比較する関数を定義していたが, 使い方が + 悪かった. それを strcasecmp() と同じものに変更した. + + * DEFS.dos: HAVE_STRCMPI を #define する代わりに, + HAVE_STRCASECMP を #define し, strcasecmp を strcmpi に #define + した. + +Sat Jul 10 01:05:04 1993 Takahiro Tanimoto (tt@isaac) + + * Version 2.0 + multi-byte extension 1.01 released. + + * grep.c (main): MSDOS の場合, argv[0] を小文字にして prog にセッ + トする. また, 拡張子は取り除く. + + * obstack.h: chunk_size の型を size_t から unsigned に変更. + old-C の場合, size_t が定義されていない状態となったため. + + * regex.h: 定数の後に U, UL をつけると old-C でコンパイルできな + い. これらをキャストに変更した. + + * regex.h: RE_DUP_MAX の定義を 16 ビット int のマシンでもオーバ + フローしない書き方に修正. + + * obstack.h: struct obstack のメンバ chunk_size の型を size_t と + した. PTR_INT_TYPE を外部から #define できるようにした. MSDOS + で SMALL MODEL 以外の場合, __PTR_TO_INT, __INT_TO_PTR とともに, + ポインタと long を変換するようにした. + + * grep.c (fillbuf, grep): read() の返り値の正負によるエラーチェッ + クを, -1 に等しいかどうかで行うように変更. + + * grep.c: totalcc, totalnl を unsigned long に変更し, prline() + 中の printf() の書式を合わせた. + + * DEFS.dos: BUFSALLOC を 4096 に #define. (See reset() in + grep.c.) + + * getpagesize.h: MSDOS の場合, ページサイズは 4096 とした. + + * dfa.c: STDC_HEADERS または HAVE_STRING_H のとき, bcopy, bzero + をマクロ展開する. + +Fri Jul 9 13:16:50 1993 Takahiro Tanimoto (tt@isaac) + + * mbc.c, mbc.h, ...: ismbchar() をモジュール毎に独立して定義する + のをやめ, モジュールを追加した. + + * search.c (Fexecute): fgrep をマルチバイト文字に対応させた. + +Wed Jul 7 17:02:33 1993 Takahiro Tanimoto (tt@isaac) + + * kwset.c (bmexec): 8 ビットクリーンでないところを修正. + + * ベースを grep-2.0 へ変更. + +Sun Jul 4 08:48:12 1993 Takahiro Tanimoto (tt@isaac) + + * regex.c (re_match_2): オリジナルのバグ. maybe_finalize_jump + の処理中, start_memory/stop_memory をスキップするところで, 引数 + のスキップをしていないバグを修正. 例えば "([a-n]+).*\1" が正し + く "abcxyzab" にマッチするようになった. + +Sat Jul 3 06:51:33 1993 Takahiro Tanimoto (tt@isaac) + + * Version 1.6 + multi-byte extension 1.00 released. + +Sat Jul 3 04:29:14 1993 Takahiro Tanimoto (tt at pc98) + + * grep.c (bufprev): -b オプションで表示するバイトオフセットを + long にするために bufprev を long とした. bufprev 以外は変更し + ていないため, 1 行のサイズが int の範囲を越えると正しく処理され + ない. また, DOS では CR+LF を 1 バイトとしてカウントしてしまう. + (手抜き) + + * regex.c (re_match_2): 文字クラスの処理中の 16 ビット int で正 + 常動作しない部分を修正. + + * regex.c (re_exec): re_search() への最後の引数を 0 から NULL へ + 修正. + + * regex.c (re_match): re_match_2() への2番目の引数を 0 から + NULL へ修正. + + * regex.c (re_search): re_search_2() への2番目の引数を 0 から + NULL へ修正. + + * grep.c (main): MS-C の setargv のバグのせいで, grep "\\" foo + とすると argv[0] == "" となってしまう. argv[0] == "" のときは強 + 制的に "grep" または "egrep" をセットするようにした. + +Fri Jul 2 19:25:58 1993 Takahiro Tanimoto (tt at pc98) + + * grep.c (main): 変数 prog の設定を DOS 用に修正した. その際, + オリジナルのやり方はまずかったので修正した. + + * grep.c: MSDOS のとき errno と sys_errlist の宣言をしないように + 修正した. + + * regex.c (set_list_bits): 使用していなかった変数を削除. + + * Makefile.msc: DOS サポートのため追加. + +Fri Jun 11 04:14:22 1993 Takahiro Tanimoto (tt@isaac) + + * grep.c: version 文字列が古いままだった. + +Tue May 25 00:10:49 1993 Takahiro Tanimoto (tt@isaac) + + * Version 1.6 + multi-byte extension 0.02 released. + +Mon May 24 15:57:31 1993 Takahiro Tanimoto (tt@isaac) + + * regex.c (re_search_2): 後方へ advance する際のバグを修正. + +Sat May 22 02:03:41 1993 Takahiro Tanimoto (tt@isaac) + + * regex.c (re_compile_fastmap): exactn で translate するのをやめ + た. re_compile_pattern で一度 translate されているはず. + + * regex.c (re_match_2): exactn の処理部分で, #if 0 を #if 1 にし + た場合, 正しい処理を行っていなかったのを修正. + +Fri May 21 20:04:07 1993 Takahiro Tanimoto (tt@isaac) + + * regex.[ch]: mbcharset, mbcharset_not を廃止. 代わりに + charset, charset_not がマルチバイト文字をも保持する. + + * grep.c (main): 下記の変更に伴って, "^.*(" ... ")" を付加する処 + 理を削除した. + + * dfa.c (regcompile): searchflag が ON のとき, 正規表現を "^.*(" + ... ")" としてコンパイルするようにした. 以前は grep.c の中で同 + じことを行っていた. + + * dfa.c (lex): 文字クラスでマルチバイト文字の1文字目の集合から, + シングルバイト文字を除外する処理を追加した. + + * dfa.c (lex): 文字クラスでシングルバイト文字の上限が間違ってい + たのを修正した. + +Wed May 19 01:27:07 1993 Takahiro Tanimoto (tt@isaac) + + * regex.c: !__STDC__ のときに const を #define. + + * dfa.h: オリジナルでは !STDC_HEADERS のときに const を #define + していたが, これを !__STDC__ のときに #define するように変更した. + + * configure.in: bcopy(), memmove() のチェックを追加. + + * dfa.c (reginit): cs_tok[] の初期化を追加した. -i フラグを付け + た場合の不具合を修正. + +Tue May 18 18:14:04 1993 Takahiro Tanimoto (tt@albert) + + * dfa.h: regex.h での RE_MBCTYPE_??? の値と一致させた. + + * regex.[ch] (RE_TRANSLATED_RANGE): mbsed-0.01 で行った拡張を輸 + 入した. + +Sat May 15 04:27:32 1993 Takahiro Tanimoto (tt@isaac) + + * マルチバイト文字対応版が一通り完成した. + + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 72 +fill-prefix: " " +version-control: never +End: diff -ruN grep-2.4.2.orig/Makefile.in grep-2.4.2/Makefile.in --- grep-2.4.2.orig/Makefile.in Thu Mar 9 13:51:02 2000 +++ grep-2.4.2/Makefile.in Sat Oct 14 15:07:56 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -294,7 +295,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/README.MB grep-2.4.2/README.MB --- grep-2.4.2.orig/README.MB Thu Jan 1 09:00:00 1970 +++ grep-2.4.2/README.MB Fri Oct 13 23:29:05 2000 @@ -0,0 +1,327 @@ +●●●●● GNU grep version 2.0 + multi-byte extension 1.04 ●●●●● +●●●●● Jun. 2, 1994 by t^2 ●●●●● + + grep-2.0+mb1.04 -- マルチバイト文字対応版 GNU grep + +●概要 + + GNU プロジェクトによる grep, egrep, fgrep (以下単に grep) をマルチバ + イト文字対応化したものです. + +●使用法 + + grep からの拡張部分だけを説明します. + + 増えたオプションは以下の通りです. + + -Wctype=ASCII + マルチバイト文字を考慮しません. このオプションを使用した場 + 合, grep のオリジナルと同じ動作になるはずです. + + -Wctype=EUC + マルチバイト文字として EUC を認識します. + + -Wctype=SJIS + マルチバイト文字として Shift-JIS を認識します. + + MS-DOS 以外のシステムで, Makefile(.in)? を書き換えずにインストー + ルした場合, デフォルトでは EUC を認識します. MS-DOS ではデフォ + ルトで Shift-JIS を認識します. + +● GREM104.LZH (MS-DOS 版実行形式を含むアーカイブ) について (それ以外の + 形態で入手された方は無視してください) + + 1. アーカイブに含まれているファイル + + オリジナルから全く手を加えていないファイル + + AUTHORS オリジナルのソースに含まれている AUTHORS + CHANGELO オリジナルのソースに含まれている ChangeLog + COPYING オリジナルのソースに含まれている COPYING + MANIFEST オリジナルのソースに含まれている MANIFEST + NEWS オリジナルのソースに含まれている NEWS + PROJECTS オリジナルのソースに含まれている PROJECTS + README オリジナルのソースに含まれている README + + grep+mb 用のファイル + + CHANGELO.MB grep+mb の変更履歴 + README.MB このファイル + + MS-DOS 版 grep+mb 用のファイル + + GREP.CAT オリジナルのソースに含まれているマニュアルページ. + grep.man を GNU roff でフォーマットしたもの. + GREP.EXE MS-DOS 版 grep-2.0+mb1.04 の実行形式 + READMAN.SED sed を持っている人へおまけ + (sed -f readman.sed grep.cat) + + 2. GREP.EXE について + + grep-2.0+mb1.04 を MS-C 6.00A でコンパイルしたものです. + + デフォルトで Shift-JIS 漢字コードを含むパターンやテキストを処理 + できます. + + setargv.obj を組み込んでありますので, MS-DOS でポピュラーなタイ + プのワイルドカードが使用できます. UNIX の csh ライクなワイルド + カード展開ルーチンを用意しようかとも思ったのですが, MS-DOS の他 + のコマンドとの整合性が取れないし, オリジナルをなるべく尊重したかっ + たので断念しました. + + 3. インストール + + GREP.EXE は, grep はもちろん, egrep, fgrep の機能を含んでいます. + grep に -E オプションを与えると egrep の動作, -F オプションを与 + えると fgrep の動作をします. また, GREP.EXE を EGREP.EXE, + FGREP.EXE という名前でコピーして egrep, fgrep として起動すると, + その名前にふさわしい動作をします. ハードディスクに余裕のない方 + 以外は, + + A>copy grep.exe a:\bin + A>copy grep.exe a:\bin\egrep.exe + A>copy grep.exe a:\bin\fgrep.exe + + などとしてご使用になられることをお勧めします. どうしてもハード + ディスクの無駄使いをしたくなければ, + + @echo off + grep -E %1 %2 %3 %4 %5 %6 %7 %8 %9 + + などのバッチファイルを作成するという手もあります. + + 4. コマンドライン引数について + + 前述したとおり MS-C の setargv.obj をリンクしていますので, その + 仕様に従わなければなりません. + + 1つ1つの引数は空白で区切ります. 引数に空白, ", \, <, >, | を + 含むときはクォーティングが必要です. その方法は COMMAND.COM のバ + グ臭い仕様と, さらに setargv.obj にも問題があり, かなり難しいの + でここでは説明を省きます. 各自研究してください. 一番簡単なのは, + 検索パターンをファイルにして + + grep -f ファイル名 + + とすることです. + + 5. マニュアル + + roff 系のフォーマッタを使えない人のために GNU roff でフォーマッ + ト済みのマニュアルを用意しました. ボールドフェース, アンダーラ + イン対応の less などでお読みください. エディタなどでは ^H が入っ + ていて読みにくいと思います. + + s/.^H//g + + という sed のプログラムに通せば, 通常のテキストファイルが得られ + ます. (^H というのはコントロールコードを直接埋めこむという意味 + です.) + +●インストール (MS-DOS 以外) + + デフォルトのマルチバイト文字の設定は, Makefile.in の中で指定します. + デフォルトを Shift-JIS とする場合と, デフォルトでマルチバイト文字を + 使用しない場合は Makefile.in の MBCTYPE_DEF マクロの定義をそれぞれ以 + 下のように変えてください. + + MBCTYPE_DEF=-DSJIS (デフォルトで Shift-JIS の場合) + MBCTYPE_DEF= (デフォルトで使用しない場合) + + いずれの場合でも起動時のオプションによりマルチバイト文字コードの選択 + が可能です. + + その他の作業は, オリジナルの grep と同様ですので INSTALL をお読みく + ださい. + +●インストール (MS-DOS 版. ここでいうインストールというのは, ソースから + のインストールのことです) + + MS-C 6.00A を使用して, デフォルトで Shift-JIS を認識する grep を作成 + する場合は, README.MSC に目を通して, 必要ならライブラリにパッチを当 + てた後, + + A>nmake -f makefile.msc + + とするだけでOKです. grep.exe を作成後, 自動的にテストを行います. + その際, grep からのエラーメッセージがいくつか表示されますが, それは + 異常ではありません. エラーを含むパターンを渡した時に, 終了ステータ + スが 2 となることを確認しているだけです. 本当に異常があった場合は + "Spencer test #nn faild" (nn は数字) と表示されます. + + テストにパスしたら, grep.exe を適当なディレクトリにコピーしてくださ + い. その際, 名前を egrep.exe, fgrep.exe と変えるだけで, それぞれ + egrep, fgrep の動作をします. そこで, 例えば a:\bin へインストールす + る場合, + + A>copy grep.exe a:\bin + A>copy grep.exe a:\bin\egrep.exe + A>copy grep.exe a:\bin\fgrep.exe + + などとします. + + その他の処理系を使用する場合や, デフォルトを Shift-JIS 以外にする場 + 合は Makefile.msc を参考に Makefile を書いてください. なお, テストに + は awk (gawk) が必要です. + +●バグ + + 1. いわゆる JIS には対応していません. 将来対応する予定もありません. + + 2. マルチバイト文字コードはあまり厳格には考えていません. + + EUC 1バイト目 ... 0x80 - 0xff + EUC 2バイト目 ... 0x01 - 0xff (0x0a を除く) + + Shift-JIS 1バイト目 ... 0x80 - 0x9f, 0xe0 - 0xff + Shift-JIS 2バイト目 ... 0x01 - 0xff (0x0a を除く) + + として処理しています. 半角カナも使えます. EUC の SS3 (0x8f) に + 始まる3バイトコードは使えません. (私はこれをサポートしているシ + ステムを見たことがない...) + + 3. -b オプションで表示されるバイトオフセットは DOS の場合 CR+LF を 1 + としてカウントした値になります. (手抜き) + +●アルゴリズム (dfa.[ch] のマルチバイト文字対応化) + + 以前は漠然と, DFA を直接 EUC や Shift-JIS のような文字種の多いコード + セットに対応させるのは, 非常に難しいと思っていました. ところがある + 日, 自作ライブラリのテスト用に, 正規表現を DFA へ変換する簡単なプロ + グラムを書いたときに, 突然うまいアイディアが閃いたのです. マルチバ + イト文字といえども結局はバイトの並びです. マルチバイト文字を, すべ + てバイト単位に分解して, 正規表現を作ってしまえばよかったのです. + + 言葉ではうまく表現できないので, 以下の記号を使用し, どういうふうにバ + イト単位に分解しているのか, 例を挙げます. + + a, b, c ... シングルバイト文字. + x, y, z ... マルチバイト文字の1文字目. + + . (任意の1文字) + ==> [a-c]|[x-z][a-z] + + (シングルバイト文字か, またはマルチバイト文字の1文字目と + 任意の1文字の連接.) + + [xb-zx] (xb から zx の範囲のマルチバイト文字) + ==> x[b-z]|y[a-z]|z[a-x] + + yb* + ==> (yb)* + + 実際には正規表現を作り出すのではなく, 正規表現を分解したトークンを直 + 接生成しています. この辺, 興味がある方はソースを見たほうが早いと思 + います. (あまりエレガントではありませんのでソースをじっくり見られる + のは恥ずかしい気もしますが...) + + これだけでは, 例えばあるテキストから xy という文字を探そうとすると, + xxyy のような文字の並びにまで反応してしまいます. そこで, マルチバイ + トモードのときには必ず "^.*(" + ユーザパターン + ")" として処理しま + す. '.*' により, '.' はマルチバイト文字の一部にはマッチしませんから, + 頭出しできるわけです. + +● dfa.[ch], regex.[ch] の拡張仕様 + + dfa.[ch], regex.[ch] モジュールは mbc.[ch] モジュールに依存していま + す. また, これはオリジナルの仕様ですが, dfa.[ch] を使用する場合は + regex.h の定義が必要です. + + マルチバイト文字のタイプは, mbc.[ch] の mbcinit() で設定します. + mbc.h に定義されているマクロ MBCTYPE_ASCII, MBCTYPE_EUC, + MBCTYPE_SJIS のいずれかを mbcinit() に渡してください. + + dfa.[ch] は, パターンのコンパイル時にだけ, この mbc.[ch] の設定を参 + 照します. パターンマッチングの際は, コンパイル時に設定されていた, + マルチバイト文字のタイプを検索します. + + 一方, regex.[ch] は, パターンコンパイル時, マッチング時の両方で + mbc.[ch] の設定を参照します. が, この両者で mbc.[ch] の設定を変更す + ることはできません. つまり, Shift-JIS で記述されたパターンを, EUC + テキストから検索するといった動作はできません. 注意してください. + + マルチバイト文字対応に伴って注意すべき正規表現を以下に記します. + + . 任意の1バイト文字, 正当なマルチバイト文字にマッチします. + 「正当なマルチバイト文字」とは, マルチバイト文字の1文字 + 目に, '\0' または '\n' 以外が続く文字のことです. + + [x-y] 文字コード (内部表現) が x から y の範囲にある任意の1文 + 字にマッチします. これも . と同じく, 正当でない文字には + マッチしません. + + [^x-y] 文字コード (内部表現) が x から y の範囲にない任意の1文 + 字にマッチします. 正当でない文字にもマッチします. + + マルチバイト文字の内部表現は単に1バイト目を上位バイト, 2バイト目を + 下位バイトとした16ビット符号なし整数です. Shift-JIS でも EUC でも + + 1バイト ASCII 文字 < 半角カナ文字 < 全角文字 + + という大小関係が成り立っています. + +●その他 + + 1. オリジナルの GNU grep の著作権は Free Software Foundation, Inc. + が有しています. パッチ部分 (grep-mb.diff) の著作権は私 (t^2) が有 + しています. + + 2. GNU grep のソースコードは各所の ftp サイト, もしくは Nifty-serve + の FUNIX のデータライブラリから入手可能です. GNU grep から + grep+mb への差分 grep-mb.diff は, 私が FUNIX へ登録し, 堂園和郎氏 + (dohzono@sdsft.kme.mei.co.jp) が fj.sources へポストしてくださっ + ています. + + 3. 差分 grep-mb.diff の再配布は自由です. これに関しては FSF の規定に + 従う必要もありません. しかし差分を適用した結果のソースコード, お + よび実行形式での再配布の際は GNU GENERAL PUBLIC LICENSE (COPYING + 参照) に従ってください. + + grep+mb に何らかの改変を加えたものを再配布する際も, GNU GENERAL + PUBLIC LICENSE に従うように注意してください. また grep+mb に含ま + れるコード (dfa.[ch] や regex.[ch]) を利用したプログラムを配布す + る際も GNU GENERAL PUBLIC LICENSE の該当部分に従ってください. + + また義務ではありませんが再配布される方は事後にでも連絡をください. + そして可能な限り, 新しいバージョンへのアップデートに努め, 利用者 + からの連絡が私に届くように配慮してください. + + 4. このプログラムは無保証です. + + 5. grep+mb に何らかの不具合が発生した場合, (FSF や, オリジナルの作者 + ではなく) 私に連絡してください. 配布した人が希望している場合は, + その人に連絡してください. + + 6. ご質問/ご要望/お叱り, その他も大歓迎です. できるかぎりサポートし + ます. + +●謝辞 + + 原作者および FSF に感謝します. + + ドキュメント作成に関して助言をくださった堂園和郎氏 + (dohzono@sdsft.kme.mei.co.jp) に感謝します. + + これまで転載/バグ報告をくださった方々に感謝します. 実名を挙げさせて + 頂きたかったのですがハードディスクのトラブルでほとんどのメールを消失 + させてしまいました. + + 最後に, 貴重なディスクスペースを grep+mb のために割いてご使用頂いて + いるすべての利用者の方々に感謝します. + +●「私」の連絡先 + + 〒810 福岡市中央区梅光園団地 7-207 (注: 転居しました) + TEL/FAX: 092-731-4025 (TEL/FAX 自動切替え) + 092-724-6342 (TEL のみ) + E-mail: NBC02362@niftyserve.or.jp 谷本孝浩 + +# Local variables: +# mode: indented-text +# indent-tabs-mode: nil +# tab-stop-list: (4 8 16 24 32 40 48 56 64 72 80) +# left-margin: 4 +# fill-column: 72 +# fill-prefix: " " +# version-control: never +# End: diff -ruN grep-2.4.2.orig/acconfig.h grep-2.4.2/acconfig.h --- grep-2.4.2.orig/acconfig.h Tue Oct 12 13:11:30 1999 +++ grep-2.4.2/acconfig.h Sat Oct 14 14:37:07 2000 @@ -27,6 +27,8 @@ #undef HAVE_LC_MESSAGES +#undef MULTI_BYTE + /* * DOS specific */ diff -ruN grep-2.4.2.orig/bootstrap/Makefile.in grep-2.4.2/bootstrap/Makefile.in --- grep-2.4.2.orig/bootstrap/Makefile.in Thu Mar 9 13:51:05 2000 +++ grep-2.4.2/bootstrap/Makefile.in Tue Oct 31 13:20:51 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -126,7 +127,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/config.hin grep-2.4.2/config.hin --- grep-2.4.2.orig/config.hin Fri Jan 28 16:00:38 2000 +++ grep-2.4.2/config.hin Sat Oct 14 14:31:18 2000 @@ -71,6 +71,8 @@ #undef HAVE_LC_MESSAGES +#undef MULTI_BYTE + /* * DOS specific */ diff -ruN grep-2.4.2.orig/configure.in grep-2.4.2/configure.in --- grep-2.4.2.orig/configure.in Wed Mar 8 14:55:06 2000 +++ grep-2.4.2/configure.in Sat Oct 14 14:29:51 2000 @@ -95,4 +95,46 @@ # the ANSI2KNR-filtering rules. LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` +# for multi-byte +mb_enable=default +AC_ARG_ENABLE(multi-byte, + [ --disable-multi-byte disable multi-byte character set], + mb_enable=$enableval) + +AC_ARG_ENABLE(ASCII, + [ --enable-ASCII set default multi-byte code to ASCII], + [test "$enableval" = "yes" && mbctype="ascii"]) +AC_ARG_ENABLE(EUC, + [ --enable-EUC set default multi-byte code to EUC (default)], + [test "$enableval" = "yes" && mbctype="euc"]) +AC_ARG_ENABLE(SJIS, + [ --enable-SJIS set defailt multi-byte code to SJIS], + [test "$enableval" = "yes" && mbctype="sjis"]) + +case "$mbctype" in +ascii) mb_enable=yes + MBCTYPE_DEF="-DASCII" ;; +sjis) mb_enable=yes + MBCTYPE_DEF="-DSJIS" ;; +euc) mb_enable=yes + MBCTYPE_DEF="-DEUC" ;; +*) MBCTYPE_DEF="-DEUC" ;; +esac + +if test $mb_enable = default; then + mb_enable=yes +fi +case $mb_enable in +yes) + AC_MSG_RESULT(enable multi-byte character set) + AC_DEFINE(MULTI_BYTE) + AC_SUBST(MBCTYPE_DEF);; +no) + AC_MSG_RESULT(disable multi-byte character set) + MBCTYPE_DEF= + AC_SUBST(MBCTYPE_DEF);; +esac + + AC_OUTPUT(Makefile src/Makefile src/posix/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile djgpp/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h]) + diff -ruN grep-2.4.2.orig/configure grep-2.4.2/configure --- grep-2.4.2.orig/configure Thu Mar 9 13:51:07 2000 +++ grep-2.4.2/configure Sat Oct 14 20:14:54 2000 @@ -23,6 +23,14 @@ --without-included-regex don't compile regex; this is the default on systems with version 2 of the GNU C library (use with caution on other system)" +ac_help="$ac_help + --disable-multi-byte disable multi-byte character set" +ac_help="$ac_help + --enable-ASCII set default multi-byte code to ASCII" +ac_help="$ac_help + --enable-EUC set default multi-byte code to EUC (default)" +ac_help="$ac_help + --enable-SJIS set defailt multi-byte code to SJIS" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -393,7 +401,7 @@ *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: WARNING: $ac_option: invalid host type" 1>&2 + echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } @@ -573,7 +581,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:577: checking for a BSD compatible install" >&5 +echo "configure:582: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -588,7 +596,7 @@ # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do - if test $ac_x $ac_dir/$ac_prog; then + if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -626,7 +634,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:630: checking whether build environment is sane" >&5 +echo "configure:635: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -683,7 +691,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:687: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:692: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -729,7 +737,7 @@ missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:733: checking for working aclocal" >&5 +echo "configure:738: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -742,7 +750,7 @@ fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:746: checking for working autoconf" >&5 +echo "configure:751: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -755,7 +763,7 @@ fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:759: checking for working automake" >&5 +echo "configure:764: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -768,7 +776,7 @@ fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:772: checking for working autoheader" >&5 +echo "configure:777: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -781,7 +789,7 @@ fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:785: checking for working makeinfo" >&5 +echo "configure:790: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -805,7 +813,7 @@ fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:809: checking host system type" >&5 +echo "configure:814: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -825,12 +833,12 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 -for ac_prog in mawk gawk nawk awk +for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:834: checking for $ac_word" >&5 +echo "configure:839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -841,7 +849,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_prog_AWK="$ac_prog" break fi @@ -862,7 +870,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:866: checking for $ac_word" >&5 +echo "configure:871: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -873,7 +881,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi @@ -892,7 +900,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:896: checking for $ac_word" >&5 +echo "configure:901: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -904,7 +912,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -943,7 +951,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:947: checking for $ac_word" >&5 +echo "configure:952: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -954,7 +962,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi @@ -975,7 +983,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:979: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:984: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -986,12 +994,12 @@ cat > conftest.$ac_ext << EOF -#line 990 "configure" +#line 995 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1017,12 +1025,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1021: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1026: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1026: checking whether we are using GNU C" >&5 +echo "configure:1031: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1031,7 +1039,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1050,7 +1058,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1054: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1059: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1093,7 +1101,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1097: checking for a BSD compatible install" >&5 +echo "configure:1102: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1108,7 +1116,7 @@ # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do - if test $ac_x $ac_dir/$ac_prog; then + if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1148,7 +1156,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1152: checking for $ac_word" >&5 +echo "configure:1157: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1159,7 +1167,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi @@ -1177,7 +1185,7 @@ echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1181: checking build system type" >&5 +echo "configure:1186: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1211,7 +1219,7 @@ # Extract the first word of "${ac_tool_prefix}getconf", so it can be a program name with args. set dummy ${ac_tool_prefix}getconf; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1215: checking for $ac_word" >&5 +echo "configure:1220: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GETCONF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1222,7 +1230,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_prog_GETCONF="${ac_tool_prefix}getconf" break fi @@ -1241,7 +1249,7 @@ echo $ac_n "checking for CFLAGS value to request large file support""... $ac_c" 1>&6 -echo "configure:1245: checking for CFLAGS value to request large file support" >&5 +echo "configure:1250: checking for CFLAGS value to request large file support" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_CFLAGS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1267,14 +1275,14 @@ ac_save_CC="$CC" CC="$CC $ac_cv_sys_largefile_CFLAGS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -1291,7 +1299,7 @@ echo "$ac_t""$ac_cv_sys_largefile_CFLAGS" 1>&6 echo $ac_n "checking for LDFLAGS value to request large file support""... $ac_c" 1>&6 -echo "configure:1295: checking for LDFLAGS value to request large file support" >&5 +echo "configure:1300: checking for LDFLAGS value to request large file support" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_LDFLAGS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1307,7 +1315,7 @@ echo "$ac_t""$ac_cv_sys_largefile_LDFLAGS" 1>&6 echo $ac_n "checking for LIBS value to request large file support""... $ac_c" 1>&6 -echo "configure:1311: checking for LIBS value to request large file support" >&5 +echo "configure:1316: checking for LIBS value to request large file support" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_LIBS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1366,7 +1374,7 @@ esac ;; esac echo $ac_n "checking for _FILE_OFFSET_BITS""... $ac_c" 1>&6 -echo "configure:1370: checking for _FILE_OFFSET_BITS" >&5 +echo "configure:1375: checking for _FILE_OFFSET_BITS" >&5 if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1395,7 +1403,7 @@ fi echo $ac_n "checking for _LARGEFILE_SOURCE""... $ac_c" 1>&6 -echo "configure:1399: checking for _LARGEFILE_SOURCE" >&5 +echo "configure:1404: checking for _LARGEFILE_SOURCE" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1424,7 +1432,7 @@ fi echo $ac_n "checking for _LARGE_FILES""... $ac_c" 1>&6 -echo "configure:1428: checking for _LARGE_FILES" >&5 +echo "configure:1433: checking for _LARGE_FILES" >&5 if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1458,7 +1466,7 @@ echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:1462: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:1467: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1474,7 +1482,7 @@ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -1511,7 +1519,7 @@ ; return 0; } EOF -if { (eval echo configure:1515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1520: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1535,7 +1543,7 @@ esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1539: checking how to run the C preprocessor" >&5 +echo "configure:1544: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1550,13 +1558,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1567,13 +1575,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1584,13 +1592,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1617,7 +1625,7 @@ echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 -echo "configure:1621: checking for function prototypes" >&5 +echo "configure:1626: checking for function prototypes" >&5 if test "$am_cv_prog_cc_stdc" != no; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1630,12 +1638,12 @@ U=_ ANSI2KNR=./ansi2knr # Ensure some checks needed by ansi2knr itself. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1634: checking for ANSI C header files" >&5 +echo "configure:1639: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1643,7 +1651,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1660,7 +1668,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1678,7 +1686,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1699,7 +1707,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1710,7 +1718,7 @@ exit (0); } EOF -if { (eval echo configure:1714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1737,17 +1745,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1741: checking for $ac_hdr" >&5 +echo "configure:1746: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1776,12 +1784,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1780: checking for size_t" >&5 +echo "configure:1785: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1809,12 +1817,12 @@ fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:1813: checking for ssize_t" >&5 +echo "configure:1818: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1842,12 +1850,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1846: checking for working const" >&5 +echo "configure:1851: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1918,12 +1926,12 @@ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1922: checking for ANSI C header files" >&5 +echo "configure:1927: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1931,7 +1939,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1948,7 +1956,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1966,7 +1974,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1987,7 +1995,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1998,7 +2006,7 @@ exit (0); } EOF -if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2025,17 +2033,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2029: checking for $ac_hdr" >&5 +echo "configure:2034: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2065,17 +2073,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2069: checking for $ac_hdr" >&5 +echo "configure:2074: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2106,12 +2114,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:2110: checking for $ac_hdr that defines DIR" >&5 +echo "configure:2115: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -2119,7 +2127,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:2123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -2143,57 +2151,8 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir""... $ac_c" 1>&6 -echo "configure:2148: checking for opendir" >&5 -if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_opendir) || defined (__stub___opendir) -choke me -#else -opendir(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_opendir=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_opendir=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'opendir`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - -if test $ac_cv_func_opendir = no; then - echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:2197: checking for opendir in -ldir" >&5 +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:2153: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2201,7 +2160,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2232,10 +2191,9 @@ echo "$ac_t""no" 1>&6 fi -fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:2239: checking for opendir in -lx" >&5 +echo "configure:2194: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2243,7 +2201,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2277,12 +2235,12 @@ fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:2281: checking whether stat file-mode macros are broken" >&5 +echo "configure:2236: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2336,19 +2294,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2340: checking for working alloca.h" >&5 +echo "configure:2295: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2369,12 +2327,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2373: checking for alloca" >&5 +echo "configure:2328: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2434,12 +2392,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2438: checking whether alloca needs Cray hooks" >&5 +echo "configure:2393: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:2468: checking for $ac_func" >&5 +echo "configure:2423: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2519,7 +2477,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2523: checking stack direction for C alloca" >&5 +echo "configure:2478: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2527,7 +2485,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2568,7 +2526,7 @@ fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:2572: checking whether closedir returns void" >&5 +echo "configure:2527: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2576,13 +2534,13 @@ ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF -if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else @@ -2608,17 +2566,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2612: checking for $ac_hdr" >&5 +echo "configure:2567: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2647,12 +2605,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2651: checking for $ac_func" >&5 +echo "configure:2606: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2700,7 +2658,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2704: checking for working mmap" >&5 +echo "configure:2659: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2708,7 +2666,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2873,12 +2831,12 @@ for ac_func in btowc isascii memmove setmode strerror wctype do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2877: checking for $ac_func" >&5 +echo "configure:2832: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2928,12 +2886,12 @@ for ac_func in memchr stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2932: checking for $ac_func" >&5 +echo "configure:2887: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2997,21 +2955,21 @@ echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3001: checking for inline" >&5 +echo "configure:2956: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3037,12 +2995,12 @@ esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3041: checking for off_t" >&5 +echo "configure:2996: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3075,17 +3033,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3079: checking for $ac_hdr" >&5 +echo "configure:3034: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3115,12 +3073,12 @@ strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3119: checking for $ac_func" >&5 +echo "configure:3074: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3172,12 +3130,12 @@ for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3176: checking for $ac_func" >&5 +echo "configure:3131: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3234,19 +3192,19 @@ if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3238: checking for LC_MESSAGES" >&5 +echo "configure:3193: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3267,7 +3225,7 @@ fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3271: checking whether NLS is requested" >&5 +echo "configure:3226: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3287,7 +3245,7 @@ EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3291: checking whether included gettext is requested" >&5 +echo "configure:3246: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3306,17 +3264,17 @@ ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3310: checking for libintl.h" >&5 +echo "configure:3265: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3333,19 +3291,19 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3337: checking for gettext in libc" >&5 +echo "configure:3292: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3361,7 +3319,7 @@ if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3365: checking for bindtextdomain in -lintl" >&5 +echo "configure:3320: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3369,7 +3327,7 @@ ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3396,12 +3354,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3400: checking for gettext in libintl" >&5 +echo "configure:3355: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:3405: checking for gettext in -lintl" >&5 +echo "configure:3360: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3409,7 +3367,7 @@ ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3464,7 +3422,7 @@ # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3468: checking for $ac_word" >&5 +echo "configure:3423: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3498,12 +3456,12 @@ for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3502: checking for $ac_func" >&5 +echo "configure:3457: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3553,12 +3511,12 @@ # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3557: checking for $ac_word" >&5 +echo "configure:3512: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in - /*|[A-z]:/*) + /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) @@ -3569,7 +3527,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi @@ -3589,7 +3547,7 @@ # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3593: checking for $ac_word" >&5 +echo "configure:3548: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3621,7 +3579,7 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3652,7 +3610,7 @@ if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:3656: checking whether catgets can be used" >&5 +echo "configure:3611: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -3665,7 +3623,7 @@ if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:3669: checking for main in -li" >&5 +echo "configure:3624: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3673,14 +3631,14 @@ ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3708,12 +3666,12 @@ fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:3712: checking for catgets" >&5 +echo "configure:3667: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -3758,12 +3716,12 @@ # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3762: checking for $ac_word" >&5 +echo "configure:3717: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GENCAT" in - /*|[A-z]:/*) + /*) ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. ;; ?:/*) @@ -3774,7 +3732,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_path_GENCAT="$ac_dir/$ac_word" break fi @@ -3794,12 +3752,12 @@ # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3798: checking for $ac_word" >&5 +echo "configure:3753: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in - /*|[A-z]:/*) + /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) @@ -3810,7 +3768,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi @@ -3831,7 +3789,7 @@ # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3835: checking for $ac_word" >&5 +echo "configure:3790: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3866,7 +3824,7 @@ # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3870: checking for $ac_word" >&5 +echo "configure:3825: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3924,7 +3882,7 @@ # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3928: checking for $ac_word" >&5 +echo "configure:3883: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3958,12 +3916,12 @@ # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3962: checking for $ac_word" >&5 +echo "configure:3917: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GMSGFMT" in - /*|[A-z]:/*) + /*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) @@ -3974,7 +3932,7 @@ ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. - if test $ac_x $ac_dir/$ac_word; then + if test -f $ac_dir/$ac_word; then ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi @@ -3994,7 +3952,7 @@ # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3998: checking for $ac_word" >&5 +echo "configure:3953: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4091,7 +4049,7 @@ LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4095: checking for catalogs to be installed" >&5 +echo "configure:4050: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4119,17 +4077,17 @@ if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4123: checking for linux/version.h" >&5 +echo "configure:4078: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4133: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4203,7 +4161,7 @@ echo $ac_n "checking for dos file convention""... $ac_c" 1>&6 -echo "configure:4207: checking for dos file convention" >&5 +echo "configure:4162: checking for dos file convention" >&5 if eval "test \"`echo '$''{'ac_cv_dosfile'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4222,12 +4180,12 @@ echo "$ac_t""$ac_cv_dosfile" 1>&6 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:4226: checking for Cygwin environment" >&5 +echo "configure:4181: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -4255,19 +4213,19 @@ CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:4259: checking for mingw32 environment" >&5 +echo "configure:4214: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -4284,19 +4242,19 @@ MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for DJGPP environment""... $ac_c" 1>&6 -echo "configure:4288: checking for DJGPP environment" >&5 +echo "configure:4243: checking for DJGPP environment" >&5 if eval "test \"`echo '$''{'ac_cv_djgpp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_djgpp=yes else @@ -4316,7 +4274,7 @@ echo $ac_n "checking for environ variable separator""... $ac_c" 1>&6 -echo "configure:4320: checking for environ variable separator" >&5 +echo "configure:4275: checking for environ variable separator" >&5 if eval "test \"`echo '$''{'ac_cv_sep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4335,7 +4293,7 @@ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4339: checking for executable suffix" >&5 +echo "configure:4294: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4345,7 +4303,7 @@ rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -4366,13 +4324,13 @@ ac_exeext=$EXEEXT echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:4370: checking for object suffix" >&5 +echo "configure:4325: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:4376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -4402,7 +4360,7 @@ # regex.c. The first failing regular expression is from `Spencer ere # test #75' in grep-2.3. echo $ac_n "checking for working re_compile_pattern""... $ac_c" 1>&6 -echo "configure:4406: checking for working re_compile_pattern" >&5 +echo "configure:4361: checking for working re_compile_pattern" >&5 if eval "test \"`echo '$''{'jm_cv_func_working_re_compile_pattern'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4410,7 +4368,7 @@ jm_cv_func_working_re_compile_pattern=no else cat > conftest.$ac_ext < @@ -4435,7 +4393,7 @@ } EOF -if { (eval echo configure:4439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then jm_cv_func_working_re_compile_pattern=yes @@ -4476,7 +4434,7 @@ if test $jm_with_regex = no; then - echo "configure: WARNING: Included src/regex.c not used" 1>&2 + echo "configure: warning: Included src/regex.c not used" 1>&2 fi # This no-op line works around a bug in automake 1.4: @@ -4488,6 +4446,62 @@ # the ANSI2KNR-filtering rules. LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` +# for multi-byte +mb_enable=default +# Check whether --enable-multi-byte or --disable-multi-byte was given. +if test "${enable_multi_byte+set}" = set; then + enableval="$enable_multi_byte" + mb_enable=$enableval +fi + + +# Check whether --enable-ASCII or --disable-ASCII was given. +if test "${enable_ASCII+set}" = set; then + enableval="$enable_ASCII" + test "$enableval" = "yes" && mbctype="ascii" +fi + +# Check whether --enable-EUC or --disable-EUC was given. +if test "${enable_EUC+set}" = set; then + enableval="$enable_EUC" + test "$enableval" = "yes" && mbctype="euc" +fi + +# Check whether --enable-SJIS or --disable-SJIS was given. +if test "${enable_SJIS+set}" = set; then + enableval="$enable_SJIS" + test "$enableval" = "yes" && mbctype="sjis" +fi + + +case "$mbctype" in +ascii) mb_enable=yes + MBCTYPE_DEF="-DASCII" ;; +sjis) mb_enable=yes + MBCTYPE_DEF="-DSJIS" ;; +euc) mb_enable=yes + MBCTYPE_DEF="-DEUC" ;; +*) MBCTYPE_DEF="-DEUC" ;; +esac + +if test $mb_enable = default; then + mb_enable=yes +fi +case $mb_enable in +yes) + echo "$ac_t""enable multi-byte character set" 1>&6 + cat >> confdefs.h <<\EOF +#define MULTI_BYTE 1 +EOF + + ;; +no) + echo "$ac_t""disable multi-byte character set" 1>&6 + MBCTYPE_DEF= + ;; +esac + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -4675,6 +4689,7 @@ s%@SEP@%$SEP%g s%@EXEEXT@%$EXEEXT%g s%@OBJEXT@%$OBJEXT%g +s%@MBCTYPE_DEF@%$MBCTYPE_DEF%g CEOF EOF @@ -4745,15 +4760,14 @@ .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*|[A-z]:/*) - srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in - [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;; + [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac @@ -4766,7 +4780,7 @@ *) ac_comsub= ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"` + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g @@ -4813,7 +4827,7 @@ echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"` + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF @@ -4917,7 +4931,7 @@ fi case "$srcdir" in - [/$]*|[A-z]:/*) ac_rel_source="$srcdir/$ac_source" ;; + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; esac @@ -4945,4 +4959,5 @@ chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff -ruN grep-2.4.2.orig/djgpp/Makefile.in grep-2.4.2/djgpp/Makefile.in --- grep-2.4.2.orig/djgpp/Makefile.in Thu Mar 9 13:51:05 2000 +++ grep-2.4.2/djgpp/Makefile.in Tue Oct 31 13:22:21 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -126,7 +127,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/doc/Makefile.in grep-2.4.2/doc/Makefile.in --- grep-2.4.2.orig/doc/Makefile.in Thu Mar 9 13:51:04 2000 +++ grep-2.4.2/doc/Makefile.in Tue Oct 31 13:24:51 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -322,7 +323,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/m4/Makefile.in grep-2.4.2/m4/Makefile.in --- grep-2.4.2.orig/m4/Makefile.in Thu Mar 9 13:51:04 2000 +++ grep-2.4.2/m4/Makefile.in Tue Oct 31 13:27:56 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -127,7 +128,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/po/POTFILES.in grep-2.4.2/po/POTFILES.in --- grep-2.4.2.orig/po/POTFILES.in Wed Nov 4 06:38:59 1998 +++ grep-2.4.2/po/POTFILES.in Tue Oct 31 16:55:07 2000 @@ -6,3 +6,4 @@ src/grep.c src/kwset.c src/obstack.c +src/regex.c diff -ruN grep-2.4.2.orig/po/ja.po grep-2.4.2/po/ja.po --- grep-2.4.2.orig/po/ja.po Thu Mar 9 13:52:57 2000 +++ grep-2.4.2/po/ja.po Tue Oct 31 16:56:30 2000 @@ -7,10 +7,13 @@ # Special thanks to # Daisuke Yamashita , 1999. # +# Modified for Version 2.4.2 + mb extension +# KAWAMURA Masao Sat Oct 14 2000 +# msgid "" msgstr "" "Project-Id-Version: GNU grep 2.4f\n" -"POT-Creation-Date: 2000-03-01 22:44-0500\n" +"POT-Creation-Date: 2000-10-31 11:54+0900\n" "PO-Revision-Date: 2000-02-16 21:05+09:00\n" "Last-Translator: IIDA Yosiaki \n" "Language-Team: Japanese \n" @@ -18,11 +21,12 @@ "Content-Type: text/plain; charset=EUC-JP\n" "Content-Transfer-Encoding: 8bit\n" -#: src/dfa.c:163 src/dfa.c:174 src/dfa.c:185 src/grep.c:902 +#. REG_ERANGE +#: src/dfa.c:168 src/dfa.c:179 src/dfa.c:190 src/grep.c:916 src/regex.c:1073 msgid "Memory exhausted" msgstr "メモリーが足りません" -#: src/dfa.c:448 +#: src/dfa.c:541 msgid "Unfinished \\ escape" msgstr "\\ エスケープが終了していません" @@ -30,32 +34,36 @@ #. {M} - exact count #. {M,} - minimum count, maximum is infinity #. {M,N} - M through N -#: src/dfa.c:581 src/dfa.c:587 src/dfa.c:597 src/dfa.c:605 src/dfa.c:620 +#: src/dfa.c:674 src/dfa.c:680 src/dfa.c:690 src/dfa.c:698 src/dfa.c:713 msgid "unfinished repeat count" msgstr "繰返しカウントが終了しません" -#: src/dfa.c:594 src/dfa.c:611 src/dfa.c:619 src/dfa.c:623 +#: src/dfa.c:687 src/dfa.c:704 src/dfa.c:712 src/dfa.c:716 msgid "malformed repeat count" msgstr "繰返しカウントが異常です" -#: src/dfa.c:688 src/dfa.c:691 src/dfa.c:718 src/dfa.c:722 src/dfa.c:723 -#: src/dfa.c:726 src/dfa.c:739 src/dfa.c:740 +#: src/dfa.c:804 src/dfa.c:807 src/dfa.c:837 src/dfa.c:841 src/dfa.c:848 +#: src/dfa.c:851 src/dfa.c:864 src/dfa.c:871 msgid "Unbalanced [" msgstr "「[」が釣り合いません" -#: src/dfa.c:886 +#: src/dfa.c:845 src/dfa.c:868 src/dfa.c:1010 +msgid "Multi-byte char incomplete" +msgstr "マルチバイト文字が不完全です" + +#: src/dfa.c:1184 msgid "Unbalanced (" msgstr "「(」が釣り合いません" -#: src/dfa.c:1000 +#: src/dfa.c:1298 msgid "No syntax specified" msgstr "構文が特定されていません" -#: src/dfa.c:1008 +#: src/dfa.c:1306 msgid "Unbalanced )" msgstr "「)」が釣り合いません" -#: src/dfa.c:1994 +#: src/dfa.c:2302 msgid "out of memory" msgstr "メモリーが足りません" @@ -118,49 +126,49 @@ msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: オプション`-W %s'は引数をとりません\n" -#: src/grep.c:185 src/grep.c:200 src/grep.c:293 src/grep.c:399 src/kwset.c:180 +#: src/grep.c:199 src/grep.c:214 src/grep.c:307 src/grep.c:413 src/kwset.c:180 #: src/kwset.c:186 src/obstack.c:471 msgid "memory exhausted" msgstr "メモリーが足りません" -#: src/grep.c:550 src/grep.c:1441 +#: src/grep.c:564 src/grep.c:1489 msgid "writing output" msgstr "出力の書込み" -#: src/grep.c:777 +#: src/grep.c:791 #, c-format msgid "Binary file %s matches\n" -msgstr "バイナリー・ファイル%sと一致します\n" +msgstr "バイナリー・ファイル%s で一致しました\n" -#: src/grep.c:791 +#: src/grep.c:805 msgid "(standard input)" msgstr "(標準入力)" -#: src/grep.c:887 +#: src/grep.c:901 #, c-format msgid "%s: warning: %s: %s\n" msgstr "%s: 警告: %s: %s\n" -#: src/grep.c:888 +#: src/grep.c:902 msgid "recursive directory loop" -msgstr "ディレクトリーが再帰的ループをしています" +msgstr "ディレクトリーが再帰的にループしています" -#: src/grep.c:938 +#: src/grep.c:952 #, c-format msgid "Usage: %s [OPTION]... PATTERN [FILE]...\n" msgstr "使用法: %s [オプション]‥‥ 文字列パターン [ファイル]‥‥\n" -#: src/grep.c:939 +#: src/grep.c:953 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "詳しくは`%s --help'を実行してください。\n" -#: src/grep.c:943 +#: src/grep.c:957 #, c-format msgid "Usage: %s [OPTION]... PATTERN [FILE] ...\n" msgstr "使用法: %s [オプション]‥‥ 文字列パターン [ファイル] ‥‥\n" -#: src/grep.c:944 +#: src/grep.c:958 #, c-format msgid "" "Search for PATTERN in each FILE or standard input.\n" @@ -173,7 +181,7 @@ "\n" "正規表現の選択と解釈方法:\n" -#: src/grep.c:949 +#: src/grep.c:963 msgid "" " -E, --extended-regexp PATTERN is an extended regular expression\n" " -F, --fixed-strings PATTERN is a set of newline-separated strings\n" @@ -184,7 +192,7 @@ "「パターン」を改行で区切られた固定の文字列とする\n" " -G, --basic-regexp 「パターン」を基本的な正規表現とする\n" -#: src/grep.c:953 +#: src/grep.c:967 msgid "" " -e, --regexp=PATTERN use PATTERN as a regular expression\n" " -f, --file=FILE obtain PATTERN from FILE\n" @@ -200,7 +208,7 @@ " -x, --line-regexp パターン一致を行全体(行単位)で行なう\n" " -z, --null-data 出力を改行でなく、ヌル値のバイトで区切る\n" -#: src/grep.c:960 +#: src/grep.c:974 msgid "" "\n" "Miscellaneous:\n" @@ -218,7 +226,7 @@ " --help 使い方を標準出力に表示する\n" " --mmap もし可能なら、入力をメモリー・マップする\n" -#: src/grep.c:968 +#: src/grep.c:982 msgid "" "\n" "Output control:\n" @@ -258,7 +266,21 @@ " -c, --count 一致した行数のみを表示する\n" " -Z, --null ファイル名の後に、ヌル値のバイトを表示\n" -#: src/grep.c:987 +#: src/grep.c:1002 +msgid "" +"\n" +"Multi-byte extension:\n" +" -W ctype=character-set, --ctype=character-set\n" +" specify the character set\n" +" character-set is ASCII, EUC, or SJIS\n" +msgstr "" +"\n" +"マルチバイト拡張:\n" +" -W ctype=character-set, --ctype=character-set\n" +" 文字セットを指定\n" +" character-set は ASCII, EUC, SJIS のいずれか\n" + +#: src/grep.c:1009 msgid "" "\n" "Context control:\n" @@ -293,7 +315,7 @@ "標準入力から読み込みます。ファイルが二つ未満の場合、-hと仮定します。\n" "もし一致があると0で、ないと1で、障害があると2で、終了します。\n" -#: src/grep.c:1002 +#: src/grep.c:1024 msgid "" "\n" "Report bugs to .\n" @@ -301,36 +323,137 @@ "\n" "バグは へ報告してください。\n" -#: src/grep.c:1012 +#: src/grep.c:1034 msgid "conflicting matchers specified" msgstr "衝突したmatcherが指定されています" -#: src/grep.c:1203 src/grep.c:1210 src/grep.c:1219 +#: src/grep.c:1225 src/grep.c:1232 src/grep.c:1241 msgid "invalid context length argument" msgstr "行数の指定が間違っています" -#: src/grep.c:1273 +#: src/grep.c:1295 msgid "unknown directories method" msgstr "ディレクトリー操作の指定が不明です" -#: src/grep.c:1358 +#: src/grep.c:1380 msgid "unknown binary-files type" msgstr "バイナリー・ファイルの指定が不明です" -#: src/grep.c:1378 +#: src/grep.c:1385 +msgid "unknown argument to -W" +msgstr "-W の指定が不明です" + +#: src/grep.c:1401 +msgid "unknown ctype" +msgstr "文字セットの指定が不明です" + +#: src/grep.c:1423 +#, c-format +msgid "%s (GNU grep) %s + mb %s\n" +msgstr "%s (GNU grep) バージョン %s + mb %s\n" + +#: src/grep.c:1425 #, c-format msgid "%s (GNU grep) %s\n" msgstr "%s (GNU grep) バージョン %s\n" -#: src/grep.c:1380 +#: src/grep.c:1428 msgid "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" msgstr "Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n" -#: src/grep.c:1382 +#: src/grep.c:1430 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" msgstr "" "これはフリー・ソフトウェアです。複製に関する条件はソースをご覧ください。\n" -"これは無保証です。営利目的やある特定の目的にむけた適正のものでもありません。" -"\n" +"これは無保証です。営利目的やある特定の目的にむけたものでもありません。\n" + +#. This section is for xgettext; it sees the strings wrapped inside +#. N_() and marks them as needing translation. They should match +#. the strings in re_error_msgid. We can't use the usual string +#. concatenation trick to initialize re_error_msgid, since other GNU +#. distributions use this file with traditional C, and traditional C +#. lacks string concatenation. +#: src/regex.c:1061 +msgid "Success" +msgstr "成功です" + +#. REG_NOERROR +#: src/regex.c:1062 +msgid "No match" +msgstr "一致しません" + +#. REG_NOMATCH +#: src/regex.c:1063 +msgid "Invalid regular expression" +msgstr "無効な正規表現です" + +#. REG_BADPAT +#: src/regex.c:1064 +msgid "Invalid collation character" +msgstr "無効な照合文字です" + +#. REG_ECOLLATE +#: src/regex.c:1065 +msgid "Invalid character class name" +msgstr "無効なキャラクタクラス名です" + +#. REG_ECTYPE +#: src/regex.c:1066 +msgid "Trailing backslash" +msgstr "バックスラッシュの後" + +#. REG_EESCAPE +#: src/regex.c:1067 +msgid "Invalid back reference" +msgstr "無効な後方参照です" + +#. REG_ESUBREG +#: src/regex.c:1068 +msgid "Unmatched [ or [^" +msgstr "[ もしくは [^ が一致しません" + +#. REG_EBRACK +#: src/regex.c:1069 +msgid "Unmatched ( or \\(" +msgstr "( もしくは \\( が一致しません" + +#. REG_EPAREN +#: src/regex.c:1070 +msgid "Unmatched \\{" +msgstr "\\{ が一致しません" + +#. REG_EBRACE +#: src/regex.c:1071 +msgid "Invalid content of \\{\\}" +msgstr "無効な \\{\\} の内容です" + +#. REG_BADBR +#: src/regex.c:1072 +msgid "Invalid range end" +msgstr "無効な終端範囲です" + +#. REG_ESPACE +#: src/regex.c:1074 +msgid "Invalid preceding regular expression" +msgstr "無効な前述の正規表現です" + +#. REG_BADRPT +#: src/regex.c:1075 +msgid "Premature end of regular expression" +msgstr "正規表現の終端が早すぎます" + +#. REG_EEND +#: src/regex.c:1076 +msgid "Regular expression too big" +msgstr "正規表現が長すぎます" + +#. REG_ESIZE +#: src/regex.c:1077 +msgid "Unmatched ) or \\)" +msgstr ") もしくは \\) が一致しません" + +#: src/regex.c:6155 +msgid "No previous regular expression" +msgstr "以前に正規表現が定義されていません" diff -ruN grep-2.4.2.orig/src/Makefile.am grep-2.4.2/src/Makefile.am --- grep-2.4.2.orig/src/Makefile.am Tue Feb 29 14:21:36 2000 +++ grep-2.4.2/src/Makefile.am Sat Oct 14 15:00:44 2000 @@ -15,6 +15,7 @@ obstack.c obstack.h \ savedir.c savedir.h \ getopt.c getopt1.c getopt.h \ + mbc.c mbc.h \ search.c getpagesize.h system.h egrep_SOURCES = $(base_sources) egrepmat.c fgrep_SOURCES = $(base_sources) fgrepmat.c @@ -29,3 +30,7 @@ dosbuf.c \ vms_fab.c vms_fab.h \ regex.h + +MBCTYPE_DEF = @MBCTYPE_DEF@ + +DEFS = $(MBCTYPE_DEF) @DEFS@ -I. -I$(srcdir) -I.. diff -ruN grep-2.4.2.orig/src/Makefile.in grep-2.4.2/src/Makefile.in --- grep-2.4.2.orig/src/Makefile.in Thu Mar 9 13:51:03 2000 +++ grep-2.4.2/src/Makefile.in Sat Oct 14 15:18:54 2000 @@ -101,7 +101,7 @@ # it is provided in GNU/Linux system # regex.c regex.h bin_PROGRAMS = grep egrep fgrep -base_sources = grep.c grep.h dfa.c dfa.h kwset.c kwset.h obstack.c obstack.h savedir.c savedir.h getopt.c getopt1.c getopt.h search.c getpagesize.h system.h +base_sources = grep.c grep.h dfa.c dfa.h kwset.c kwset.h obstack.c obstack.h savedir.c savedir.h getopt.c getopt1.c getopt.h mbc.c mbc.h search.c getpagesize.h system.h egrep_SOURCES = $(base_sources) egrepmat.c fgrep_SOURCES = $(base_sources) fgrepmat.c @@ -114,30 +114,32 @@ EXTRA_DIST = dosbuf.c vms_fab.c vms_fab.h regex.h + +MBCTYPE_DEF = @MBCTYPE_DEF@ + +DEFS = $(MBCTYPE_DEF) @DEFS@ -I. -I$(srcdir) -I.. mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = bin_PROGRAMS = grep$(EXEEXT) egrep$(EXEEXT) fgrep$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) - -DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ANSI2KNR = @ANSI2KNR@ grep_OBJECTS = grep$U.o dfa$U.o kwset$U.o obstack$U.o savedir$U.o \ -getopt$U.o getopt1$U.o search$U.o grepmat$U.o +getopt$U.o getopt1$U.o mbc$U.o search$U.o grepmat$U.o grep_LDADD = $(LDADD) grep_DEPENDENCIES = @ALLOCA@ @LIBOBJS@ grep_LDFLAGS = egrep_OBJECTS = grep$U.o dfa$U.o kwset$U.o obstack$U.o savedir$U.o \ -getopt$U.o getopt1$U.o search$U.o egrepmat$U.o +getopt$U.o getopt1$U.o mbc$U.o search$U.o egrepmat$U.o egrep_LDADD = $(LDADD) egrep_DEPENDENCIES = @ALLOCA@ @LIBOBJS@ egrep_LDFLAGS = fgrep_OBJECTS = grep$U.o dfa$U.o kwset$U.o obstack$U.o savedir$U.o \ -getopt$U.o getopt1$U.o search$U.o fgrepmat$U.o +getopt$U.o getopt1$U.o mbc$U.o search$U.o fgrepmat$U.o fgrep_LDADD = $(LDADD) fgrep_DEPENDENCIES = @ALLOCA@ @LIBOBJS@ fgrep_LDFLAGS = @@ -262,6 +264,8 @@ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/grepmat.c; then echo $(srcdir)/grepmat.c; else echo grepmat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > grepmat_.c kwset_.c: kwset.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kwset.c; then echo $(srcdir)/kwset.c; else echo kwset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kwset_.c +mbc_.c: mbc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mbc.c; then echo $(srcdir)/mbc.c; else echo mbc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mbc_.c memchr_.c: memchr.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memchr.c; then echo $(srcdir)/memchr.c; else echo memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memchr_.c obstack_.c: obstack.c $(ANSI2KNR) @@ -275,8 +279,8 @@ stpcpy_.c: stpcpy.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c alloca_.o dfa_.o egrepmat_.o fgrepmat_.o getopt_.o getopt1_.o grep_.o \ -grepmat_.o kwset_.o memchr_.o obstack_.o regex_.o savedir_.o search_.o \ -stpcpy_.o : $(ANSI2KNR) +grepmat_.o kwset_.o mbc_.o memchr_.o obstack_.o regex_.o savedir_.o \ +search_.o stpcpy_.o : $(ANSI2KNR) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -375,7 +379,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/src/dfa.c grep-2.4.2/src/dfa.c --- grep-2.4.2.orig/src/dfa.c Wed Feb 2 14:49:06 2000 +++ grep-2.4.2/src/dfa.c Tue Oct 31 16:57:23 2000 @@ -17,6 +17,8 @@ /* Written June, 1988 by Mike Haertel Modified July, 1988 by Arthur David Olson to assist BMG speedups */ +/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto) + Last change: Jul. 10, 1993 by t^2 */ #ifdef HAVE_CONFIG_H #include @@ -102,6 +104,9 @@ #include "regex.h" #include "dfa.h" +#ifdef MULTI_BYTE +#include "mbc.h" +#endif /* HPUX, define those as macros in sys/param.h */ #ifdef setbit @@ -209,7 +214,14 @@ if (t < 0) fprintf(stderr, "END"); else if (t < NOTCHAR) +#ifdef MULTI_BYTE + if (t & 0x80) + fprintf(stderr, "0x%02x", (unsigned char)t); + else + fprintf(stderr, "%c", t); +#else fprintf(stderr, "%c", t); +#endif /* MULTI_BYTE */ else { switch (t) @@ -295,6 +307,20 @@ return 1; } +#ifdef MULTI_BYTE +static int +isemptyset(s) + charclass s; +{ + int i; + + for (i = 0; i < CHARCLASS_INTS; i++) + if (s[i]) + return 0; + return 1; +} +#endif + /* A pointer to the current dfa is kept here during parsing. */ static struct dfa *dfa; @@ -346,6 +372,70 @@ static int parens; /* Count of outstanding left parens. */ static int minrep, maxrep; /* Repeat counts for {m,n}. */ +#ifdef MULTI_BYTE +static charclass cs_cset[8]; +static token cs_tok[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + +static enum { + MBEXTTOK_NONE = -1, + MBEXTTOK_NOTCHAR = 256, + MBEXTTOK_ORMBC = MBEXTTOK_NOTCHAR, + MBEXTTOK_ORMBC_NL, + MBEXTTOK_CLASS, + MBEXTTOK_INVCLASS, +} mbexttok = MBEXTTOK_NONE; + +static charclass mbcset_set; +static charclass mbcset_all; +static charclass mbcset[128]; /* 128*256/8 = 4 Kbytes */ + +/* 頻繁に使用される (と思われる) 文字集合をトークンとして返す. + n = 0 ... 1バイト文字全体の集合. + 1 ... 2バイト文字の1バイト目全体の集合. + 2 ... 2バイト文字の2バイト目全体の集合. + +4 ... '\n'を除外しない. */ +static token +setcodeset(n) + int n; +{ + token c; + + if (!cs_tok[n]) { + zeroset(cs_cset[n]); + switch (n) { + case 0: + case 4: + /* 1バイト文字全体の集合. */ + for (c = 0; c < NOTCHAR; c++) + if (ismbchar(c)) + setbit(c, cs_cset[n]); + notset(cs_cset[n]); + break; + case 1: + case 5: + /* 2バイト文字の1文字目全体の集合. */ + for (c = 0; c < NOTCHAR; c++) + if (ismbchar(c)) + setbit(c, cs_cset[n]); + break; + case 2: + case 6: + /* 2バイト文字の2文字目全体の集合. */ + notset(cs_cset[n]); + break; + } + if (!(n & 4)) { + if (syntax_bits & RE_DOT_NOT_NULL || n != 0) + clrbit('\0', cs_cset[n]); + if (!(syntax_bits & RE_DOT_NEWLINE) || n != 0) + clrbit(eolbyte, cs_cset[n]); + } + cs_tok[n] = CSET + charclass_index(cs_cset[n]); + } + return cs_tok[n]; +} +#endif /* MULTI_BYTE */ + /* Note that characters become unsigned here. */ #define FETCH(c, eoferr) \ { \ @@ -436,6 +526,9 @@ main switch inside the backslash case. On the minus side, it means that just about every case begins with "if (backslash) ...". */ +#ifdef MULTI_BYTE + mbexttok = MBEXTTOK_NONE; +#endif /* MULTI_BYTE */ for (i = 0; i < 2; ++i) { FETCH(c, 0); @@ -659,6 +752,12 @@ case '.': if (backslash) goto normal_char; +#ifdef MULTI_BYTE + if (current_mbctype != MBCTYPE_ASCII) + mbexttok = MBEXTTOK_ORMBC; + laststart = 0; + return lasttok = setcodeset(0); +#else zeroset(ccl); notset(ccl); if (!(syntax_bits & RE_DOT_NEWLINE)) @@ -667,17 +766,34 @@ clrbit('\0', ccl); laststart = 0; return lasttok = CSET + charclass_index(ccl); +#endif /* MULTI_BYTE */ case 'w': +#ifdef MULTI_BYTE + if (!backslash || (syntax_bits & RE_NO_GNU_OPS)) + goto normal_char; + zeroset(ccl); + for (c2 = 0; c2 < NOTCHAR; ++c2) + if (IS_WORD_CONSTITUENT(c2)) + setbit(c2, ccl); + laststart = 0; + return lasttok = CSET + charclass_index(ccl); +#endif /* MULTI_BYTE */ case 'W': if (!backslash || (syntax_bits & RE_NO_GNU_OPS)) goto normal_char; zeroset(ccl); for (c2 = 0; c2 < NOTCHAR; ++c2) +#ifdef MULTI_BYTE + if (!IS_WORD_CONSTITUENT(c2) && !ismbchar(c2)) + setbit(c2, ccl); + mbexttok = MBEXTTOK_ORMBC_NL; +#else if (IS_WORD_CONSTITUENT(c2)) setbit(c2, ccl); if (c == 'W') notset(ccl); +#endif /* MULTI_BYTE */ laststart = 0; return lasttok = CSET + charclass_index(ccl); @@ -695,6 +811,9 @@ invert = 0; do { +#ifdef MULTI_BYTE + unsigned char cm = 0, c2m = 0; +#endif /* MULTI_BYTE */ /* Nobody ever said this had to be fast. :-) Note that if we're looking at some other [:...:] construct, we just treat it as a bunch of ordinary @@ -720,6 +839,12 @@ } if (c == '\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) FETCH(c, _("Unbalanced [")); +#ifdef MULTI_BYTE + if (ismbchar(c)) { + cm = (unsigned char)c; + FETCH(c, _("Multi-byte char incomplete")); + } +#endif /* MULTI_BYTE */ FETCH(c1, _("Unbalanced [")); if (c1 == '-') { @@ -730,6 +855,9 @@ which is left in c1, the lookahead character. */ --lexptr; ++lexleft; +#ifdef MULTI_BYTE + c2m = cm; +#endif /* MULTI_BYTE */ c2 = c; } else @@ -737,12 +865,95 @@ if (c2 == '\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS)) FETCH(c2, _("Unbalanced [")); +#ifdef MULTI_BYTE + if (ismbchar(c2)) { + c2m = (unsigned char)c2; + FETCH(c2, _("Multi-byte char incomplete")); + } +#endif /* MULTI_BYTE */ FETCH(c1, _("Unbalanced [")); } } else +#ifdef MULTI_BYTE + { + c2m = cm; +#endif /* MULTI_BYTE */ c2 = c; +#ifdef MULTI_BYTE + } +#endif /* MULTI_BYTE */ +#ifdef MULTI_BYTE + if (cm < c2m || (cm == c2m && c <= c2)) { + if (cm == 0) { + cm = (unsigned char)c2; + if (c2m > 0) + cm = NOTCHAR - 1; + for (; (unsigned char)c <= cm; c++) { + setbit(c, ccl); + if (case_fold) { + if (ISUPPER(c)) + setbit(tolower(c), ccl); + else if (ISLOWER(c)) + setbit(toupper(c), ccl); + } + } + cm = 0x80; + c = 0x00; + } + if (cm <= c2m) { + if (mbexttok < 0) { + mbexttok = MBEXTTOK_CLASS; + zeroset(mbcset_set); + zeroset(mbcset_all); + } + if (cm < c2m && c != 0x00) { /* 最初の半端 */ + int t; + + if (ismbchar(cm) + && ((t = tstbit(cm, mbcset_set)) + || !tstbit(cm, mbcset_all))) { + if (!t) { + setbit(cm, mbcset_set); + zeroset(mbcset[cm - 0x80]); + } + for (; c < NOTCHAR; c++) + setbit(c, mbcset[cm - 0x80]); + } + cm++; + c = 0x00; + } + if (cm < c2m || (cm == c2m && c == 0x00 && c2 == 0xff)) { + if (c == 0x00 && c2 == 0xff) + c2m++; + for (; cm < c2m; cm++) + if (ismbchar(cm)) { + clrbit(cm, mbcset_set); + setbit(cm, mbcset_all); + } + if (c == 0x00 && c2 == 0xff) + c2m--; + c = 0x00; + } + if (cm <= c2m) { + int t; + + /* ここでは必ず c <= c2 となっている. */ + if (ismbchar(cm) + && ((t = tstbit(cm, mbcset_set)) + || !tstbit(cm, mbcset_all))) { + if (!t) { + setbit(cm, mbcset_set); + zeroset(mbcset[cm - 0x80]); + } + for (; c <= c2; c++) + setbit(c, mbcset[cm - 0x80]); + } + } + } + } +#else /* !MULTI_BYTE */ lo[0] = c; lo[1] = '\0'; hi[0] = c2; hi[1] = '\0'; for (c = 0; c < NOTCHAR; c++) @@ -761,7 +972,7 @@ } } } - +#endif /* MULTI_BYTE */ skip: ; } @@ -771,13 +982,41 @@ notset(ccl); if (syntax_bits & RE_HAT_LISTS_NOT_NEWLINE) clrbit(eolbyte, ccl); +#ifdef MULTI_BYTE + if (mbexttok == MBEXTTOK_CLASS) { + mbexttok = MBEXTTOK_INVCLASS; + if (!isemptyset(mbcset_set)) { + for (c = 0x80; c <= 0xff; c++) + if (tstbit(c, mbcset_set)) + notset(mbcset[c - 0x80]); + } + notset(mbcset_all); + for (c = 0; c <= 0xff; c++) + if (!ismbchar(c)) + clrbit(c, mbcset_all); + } + else + mbexttok = MBEXTTOK_ORMBC_NL; +#endif /* MULTI_BYTE */ } +#ifdef MULTI_BYTE + if (current_mbctype != MBCTYPE_ASCII) + for (c = 0x80; c <= 0xff; c++) + if (ismbchar(c)) + clrbit(c, ccl); +#endif /* MULTI_BYTE */ laststart = 0; return lasttok = CSET + charclass_index(ccl); default: normal_char: laststart = 0; +#ifdef MULTI_BYTE + if (ismbchar(c)) { + FETCH(mbexttok, _("Multi-byte char incomplete")); + return c; + } +#endif /* MULTI_BYTE */ if (case_fold && ISALPHA(c)) { zeroset(ccl); @@ -871,6 +1110,71 @@ static void atom (void) { +#ifdef MULTI_BYTE + if (mbexttok >= 0) { + if (mbexttok < MBEXTTOK_NOTCHAR) { + addtok(tok); + addtok(mbexttok); + addtok(CAT); + } + else + switch (mbexttok) { + case MBEXTTOK_ORMBC: + case MBEXTTOK_ORMBC_NL: + addtok(tok); + if (mbexttok == MBEXTTOK_ORMBC) { + addtok(setcodeset(1)); + addtok(setcodeset(2)); + } + else { + addtok(setcodeset(5)); + addtok(setcodeset(6)); + } + addtok(CAT); + addtok(OR); + break; + case MBEXTTOK_CLASS: + case MBEXTTOK_INVCLASS: + { + token c; + + addtok(tok); + if (!isemptyset(mbcset_set)) + for (c = 0x80; c <= 0xff; c++) + if (tstbit(c, mbcset_set)) { + /* Make sure all bits in mbcset_all valid. */ + clrbit(c, mbcset_all); + addtok(c); + if (mbexttok == MBEXTTOK_CLASS) { + clrbit(eolbyte, mbcset[c - 0x80]); + clrbit('\0', mbcset[c - 0x80]); + } + else { + setbit(eolbyte, mbcset[c - 0x80]); + setbit('\0', mbcset[c - 0x80]); + } + addtok(CSET + charclass_index(mbcset[c - 0x80])); + addtok(CAT); + addtok(OR); + } + if (!isemptyset(mbcset_all)) { + addtok(CSET + charclass_index(mbcset_all)); + if (mbexttok == MBEXTTOK_CLASS) + addtok(setcodeset(2)); + else + addtok(setcodeset(6)); + addtok(CAT); + addtok(OR); + } + } + break; + default: + break; + } + tok = lex(); + } + else +#endif /* MULTI_BYTE */ if ((tok >= 0 && tok < NOTCHAR) || tok >= CSET || tok == BACKREF || tok == BEGLINE || tok == ENDLINE || tok == BEGWORD || tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD) @@ -1978,6 +2282,9 @@ d->tralloc = 0; d->musts = 0; +#ifdef MULTI_BYTE + bzero(cs_tok, sizeof cs_tok); +#endif /* MULTI_BYTE */ } /* Parse and analyze a single string of the given length. */ @@ -1987,21 +2294,66 @@ if (case_fold) /* dummy folding in service of dfamust() */ { char *lcopy; +#ifdef MULTI_BYTE + char *p; +#endif /* MULTI_BYTE */ int i; +#ifdef MULTI_BYTE + p = lcopy = malloc(len + 7); +#else lcopy = malloc(len); +#endif /* MULTI_BYTE */ if (!lcopy) dfaerror(_("out of memory")); /* This is a kludge. */ case_fold = 0; +#ifdef MULTI_BYTE + if (current_mbctype != MBCTYPE_ASCII && searchflag) { + *p++ = '^'; + *p++ = '.'; + *p++ = '*'; + if (!(syntax_bits & RE_NO_BK_PARENS)) + *p++ = '\\'; + *p++ = '('; + } +#endif /* MULTI_BYTE */ for (i = 0; i < len; ++i) if (ISUPPER ((unsigned char) s[i])) +#ifdef MULTI_BYTE + *p++ = tolower ((unsigned char) s[i]); + else + *p++ = s[i]; +#else lcopy[i] = tolower ((unsigned char) s[i]); else lcopy[i] = s[i]; +#endif /* MULTI_BYTE */ +#ifdef MULTI_BYTE + if (current_mbctype != MBCTYPE_ASCII && searchflag) { + if (!(syntax_bits & RE_NO_BK_PARENS)) + *p++ = '\\'; + *p++ = ')'; + } +#endif /* MULTI_BYTE */ dfainit(d); +#ifdef MULTI_BYTE + dfaparse(lcopy, p - lcopy, d); + dfamust(d); + d->cindex = d->tindex = d->depth = d->nleaves = d->nregexps = 0; + bzero(cs_tok, sizeof cs_tok); + case_fold = 1; + if (current_mbctype != MBCTYPE_ASCII && searchflag) { + bcopy(s, lcopy + (syntax_bits & RE_NO_BK_PARENS ? 4 : 5), len); + dfaparse(lcopy, p - lcopy, d); + } + else + dfaparse(s, len, d); + dfaanalyze(d, searchflag); + free(lcopy); +#else dfaparse(lcopy, len, d); free(lcopy); dfamust(d); @@ -2009,11 +2361,35 @@ case_fold = 1; dfaparse(s, len, d); dfaanalyze(d, searchflag); +#endif /* MULTI_BYTE */ } else { dfainit(d); +#ifdef MULTI_BYTE + if (current_mbctype != MBCTYPE_ASCII && searchflag) { + char *lcopy, *p; + + p = lcopy = malloc(len + 7); + *p++ = '^'; + *p++ = '.'; + *p++ = '*'; + if (!(syntax_bits & RE_NO_BK_PARENS)) + *p++ = '\\'; + *p++ = '('; + bcopy(s, p, len); + p += len; + if (!(syntax_bits & RE_NO_BK_PARENS)) + *p++ = '\\'; + *p++ = ')'; + dfaparse(lcopy, p - lcopy, d); + free(lcopy); + } + else + dfaparse(s, len, d); +#else dfaparse(s, len, d); +#endif /* MULTI_BYTE */ dfamust(d); dfaanalyze(d, searchflag); } diff -ruN grep-2.4.2.orig/src/grep.c grep-2.4.2/src/grep.c --- grep-2.4.2.orig/src/grep.c Wed Feb 2 14:49:07 2000 +++ grep-2.4.2/src/grep.c Sat Oct 14 17:24:21 2000 @@ -17,6 +17,10 @@ 02111-1307, USA. */ /* Written July 1992 by Mike Haertel. */ +/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto) + Last change: Jun. 2, 1994 by t^2 */ + +#define MB_REL "1.04a" #ifdef HAVE_CONFIG_H # include @@ -36,6 +40,9 @@ #include "getpagesize.h" #include "grep.h" #include "savedir.h" +#ifdef MULTI_BYTE +#include "mbc.h" +#endif /* MULTI_BYTE */ #undef MAX #define MAX(A,B) ((A) > (B) ? (A) : (B)) @@ -60,7 +67,11 @@ /* Short options. */ static char const short_options[] = +#ifdef MULTI_BYTE +"0123456789A:B:C::EFGHIUVX:abcd:e:f:hiLlnqrsuvwxyZzW:"; +#else "0123456789A:B:C::EFGHIUVX:abcd:e:f:hiLlnqrsuvwxyZz"; +#endif /* MULTI_BYTE */ /* Non-boolean long options that have no corresponding short equivalents. */ enum @@ -105,6 +116,9 @@ {"version", no_argument, NULL, 'V'}, {"with-filename", no_argument, NULL, 'H'}, {"word-regexp", no_argument, NULL, 'w'}, +#ifdef MULTI_BYTE + {"ctype", required_argument, NULL, 'T'}, +#endif /* MULTI_BYTE */ {0, 0, 0, 0} }; @@ -984,6 +998,14 @@ -l, --files-with-matches only print FILE names containing matches\n\ -c, --count only print a count of matching lines per FILE\n\ -Z, --null print 0 byte after FILE name\n")); +#ifdef MULTI_BYTE + printf (_("\ +\n\ +Multi-byte extension:\n\ + -W ctype=character-set, --ctype=character-set\n\ + specify the character set\n\ + character-set is ASCII, EUC, or SJIS\n")); +#endif /* MULTI_BYTE */ printf (_("\ \n\ Context control:\n\ @@ -1357,6 +1379,28 @@ else fatal (_("unknown binary-files type"), 0); break; +#ifdef MULTI_BYTE + case 'W': + if (strncasecmp(optarg, "ctype=", 6) != 0) + fatal(_("unknown argument to -W"), 0); + optarg += 6; + /* Fall Through */ + case 'T': + if (strcasecmp(optarg, "ASCII") == 0) { + mbcinit(MBCTYPE_ASCII); + break; + } + if (strcasecmp(optarg, "EUC") == 0) { + mbcinit(MBCTYPE_EUC); + break; + } + if (strcasecmp(optarg, "SJIS") == 0) { + mbcinit(MBCTYPE_SJIS); + break; + } + fatal(_("unknown ctype"), 0); + break; +#endif /* MULTI_BYTE */ case 0: /* long options */ break; @@ -1375,7 +1419,11 @@ if (show_version) { +#ifdef MULTI_BYTE + printf (_("%s (GNU grep) %s + mb %s\n"), matcher, VERSION, MB_REL); +#else printf (_("%s (GNU grep) %s\n"), matcher, VERSION); +#endif printf ("\n"); printf (_("\ Copyright 1988, 1992-1999, 2000 Free Software Foundation, Inc.\n")); diff -ruN grep-2.4.2.orig/src/mbc.c grep-2.4.2/src/mbc.c --- grep-2.4.2.orig/src/mbc.c Thu Jan 1 09:00:00 1970 +++ grep-2.4.2/src/mbc.c Fri Oct 13 23:29:48 2000 @@ -0,0 +1,98 @@ +/* Functions for multi-byte support. + Created for grep multi-byte extension Jul., 1993 by t^2 (Takahiro Tanimoto) + Last change: Jul. 9, 1993 by t^2 */ +#include "mbc.h" + +static const unsigned char mbctab_ascii[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static const unsigned char mbctab_euc[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +}; + +static const unsigned char mbctab_sjis[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +}; + +#ifdef EUC +const unsigned char *mbctab = mbctab_euc; +int current_mbctype = MBCTYPE_EUC; +#else +#ifdef SJIS +const unsigned char *mbctab = mbctab_sjis; +int current_mbctype = MBCTYPE_SJIS; +#else +const unsigned char *mbctab = mbctab_ascii; +int current_mbctype = MBCTYPE_ASCII; +#endif +#endif + +void +#ifdef __STDC__ +mbcinit(int mbctype) +#else +mbcinit(mbctype) + int mbctype; +#endif +{ + switch (mbctype) { + case MBCTYPE_ASCII: + mbctab = mbctab_ascii; + current_mbctype = MBCTYPE_ASCII; + break; + case MBCTYPE_EUC: + mbctab = mbctab_euc; + current_mbctype = MBCTYPE_EUC; + break; + case MBCTYPE_SJIS: + mbctab = mbctab_sjis; + current_mbctype = MBCTYPE_SJIS; + break; + } +} diff -ruN grep-2.4.2.orig/src/mbc.h grep-2.4.2/src/mbc.h --- grep-2.4.2.orig/src/mbc.h Thu Jan 1 09:00:00 1970 +++ grep-2.4.2/src/mbc.h Sat Oct 7 17:14:17 2000 @@ -0,0 +1,30 @@ +#ifndef MBC_H +#define MBC_H 1 +/* Definitions for multi-byte support. + Created for grep multi-byte extension Jul., 1993 by t^2 (Takahiro Tanimoto) + Last change: Jul. 9, 1993 by t^2 */ + +#ifndef const +#ifndef __STDC__ +#ifdef __GNUC__ +#define const __const__ +#define volatile __volatile__ +#else +#define const +#define volatile +#endif +#endif +#endif + +#define MBCTYPE_ASCII 0 +#define MBCTYPE_EUC 1 +#define MBCTYPE_SJIS 2 + +extern const unsigned char *mbctab; +extern int current_mbctype; + +void mbcinit (int); + +#define ismbchar(c) mbctab[(unsigned char)c] + +#endif /* !MBC_H */ diff -ruN grep-2.4.2.orig/src/posix/Makefile.in grep-2.4.2/src/posix/Makefile.in --- grep-2.4.2.orig/src/posix/Makefile.in Thu Mar 9 13:51:03 2000 +++ grep-2.4.2/src/posix/Makefile.in Tue Oct 31 13:29:49 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -126,7 +127,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/src/regex.c grep-2.4.2/src/regex.c --- grep-2.4.2.orig/src/regex.c Tue Jan 25 13:50:42 2000 +++ grep-2.4.2/src/regex.c Tue Oct 31 16:58:15 2000 @@ -19,6 +19,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Multi-byte extension added May, 1993 by t^2 (Takahiro Tanimoto) + Last change: Aug. 19, 1993 by t^2 */ + /* AIX requires this to be the first thing in the file. */ #if defined _AIX && !defined REGEX_MALLOC #pragma alloca @@ -167,6 +170,9 @@ /* Get the interface, including the syntax bits. */ #include +#ifdef MULTI_BYTE +#include "mbc.h" +#endif /* MULTI_BYTE */ /* isalpha etc. are used for the character classes. */ #include @@ -596,6 +602,23 @@ # endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ + +#ifdef MULTI_BYTE +#define STORE_MBC(p, c) \ + ((p)[0] = (unsigned char) ((c) >> 8), (p)[1] = (unsigned char) (c)) +#define STORE_MBC_AND_INCR(p, c) \ + (*(p)++ = (unsigned char) ((c) >> 8), *(p)++ = (unsigned char) (c)) + +#define EXTRACT_MBC(p) \ + ((unsigned char) (p)[0] << 8 | (unsigned char) (p)[1]) +#define EXTRACT_MBC_AND_INCR(p) \ + ((p) += 2, (unsigned char) (p)[-2] << 8 | (unsigned char) (p)[-1]) + +#define EXTRACT_UNSIGNED(p) \ + ((unsigned char) (p)[0] | (unsigned char) (p)[1] << 8) +#define EXTRACT_UNSIGNED_AND_INCR(p) \ + ((p) += 2, (unsigned char) (p)[-2] | (unsigned char) (p)[-1] << 8) +#endif /* MULTI_BYTE */ /* If DEBUG is defined, Regex prints many voluminous messages about what it is doing (if the variable `debug' is nonzero). If linked with the @@ -691,6 +714,12 @@ do { putchar ('/'); +#ifdef MULTI_BYTE + if (ismbchar (*p) && 2 <= mcnt) { + printf ("/%.2s", (char *) p), p += 2, --mcnt; + continue; + } +#endif /* MULTI_BYTE */ putchar (*p++); } while (--mcnt); @@ -751,9 +780,22 @@ if (in_range) putchar (last); - putchar (']'); +#ifdef MULTI_BYTE + p += 1 + *p; + { + unsigned short i, size; + size = EXTRACT_UNSIGNED_AND_INCR (p); + for (i = 0; i < size; i++) + printf ("%.2s-%.2s", (char *) p, (char *) p + 2), + p += 4; + } + putchar (']'); +#else + putchar (']'); + p += 1 + *p; +#endif /* MULTI_BYTE */ } break; @@ -1573,22 +1615,33 @@ reg_syntax_t syntax)); static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend, reg_syntax_t syntax)); +#ifndef MULTI_BYTE static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b)); +#endif /* ! MULTI_BYTE */ /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ #ifndef PATFETCH +#ifdef MULTI_BYTE +# define PATFETCH(c) \ + do {if (p == pend) return REG_EEND; \ + c = (unsigned char) *p++; \ + if (translate && !ismbchar (c)) \ + c = (unsigned char) translate[(unsigned char)c]; \ + } while (0) +#else # define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ if (translate) c = (unsigned char) translate[c]; \ } while (0) +#endif /* MULTI_BYTE */ #endif /* Fetch the next character in the uncompiled pattern, with no @@ -1607,8 +1660,13 @@ `char *', to avoid warnings when a string constant is passed. But when we use a character as a subscript we must make it unsigned. */ #ifndef TRANSLATE +#ifdef MULTI_BYTE +# define TRANSLATE(d) \ + (translate ? (unsigned char) translate[(unsigned char) (d)] : (d)) +#else # define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) +#endif /* MULTI_BYTE */ #endif @@ -1811,6 +1869,163 @@ || STREQ (string, "cntrl") || STREQ (string, "blank")) #endif +#ifdef MULTI_BYTE +/* Handle charset(_not)?. + + Structure of charset(_not)? in compiled pattern. + + struct { + unsinged char id; charset(_not)? + unsigned char sbc_size; + unsigned char sbc_map[sbc_size]; same as original up to here. + unsigned short mbc_size; number of intervals. + struct { + unsigned short beg; beginning of interval. + unsigned short end; end of interval. + } intervals[mbc_size]; + }; */ + +static reg_errcode_t +#ifdef __STDC__ +set_list_bits (unsigned short c1, unsigned short c2, + reg_syntax_t syntax, unsigned char *b, const char *translate) +#else +set_list_bits (c1, c2, syntax, b, translate) + unsigned short c1, c2; + reg_syntax_t syntax; + unsigned char *b; + const char *translate; +#endif +{ + unsigned char sbc_size = b[-1]; + unsigned short mbc_size = EXTRACT_UNSIGNED (&b[sbc_size]); + unsigned short beg, end, upb; + + if (c1 > c2) + return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; + if (c1 < 1 << BYTEWIDTH) { + upb = c2; + if (1 << BYTEWIDTH <= upb) + upb = (1 << BYTEWIDTH) - 1; /* The last single-byte char */ + if (sbc_size <= upb / BYTEWIDTH) { + /* Allocate maximum size so it never happens again. */ + /* NOTE: memcpy() would not work here. */ + bcopy (&b[sbc_size], &b[(1 << BYTEWIDTH) / BYTEWIDTH], 2 + mbc_size*4); + bzero (&b[sbc_size], (1 << BYTEWIDTH) / BYTEWIDTH - sbc_size); + b[-1] = sbc_size = (1 << BYTEWIDTH) / BYTEWIDTH; + } + if (!translate) { + for (; c1 <= upb; c1++) + if (!ismbchar (c1)) + SET_LIST_BIT (c1); + } + else + for (; c1 <= upb; c1++) + if (!ismbchar (c1)) + SET_LIST_BIT (TRANSLATE (c1)); + if (c2 < 1 << BYTEWIDTH) + return REG_NOERROR; + c1 = 0x8000; /* The first wide char */ + } + b = &b[sbc_size + 2]; + + /* intervals[beg] + ●----------● ●----------● + c1 + ○----------------------● + + 上図のような区間のインデックス beg を決定する. */ + for (beg = 0, upb = mbc_size; beg < upb; ) { + unsigned short mid = (beg + upb) >> 1; + + if (c1 - 1 > EXTRACT_MBC (&b[mid*4 + 2])) + beg = mid + 1; + else + upb = mid; + } + + /* intervals[end] + ●-------● ●----------● + c2 + ●---------------○ + + 上図のような区間のインデックス end を決定する. */ + for (end = beg, upb = mbc_size; end < upb; ) { + unsigned short mid = (end + upb) >> 1; + + if (c2 >= EXTRACT_MBC (&b[mid*4]) - 1) + end = mid + 1; + else + upb = mid; + } + + if (beg != end) { + /* 既存の区間を少なくとも1つ統合する場合, + 区間の始点, 終点を修正する. */ + if (c1 > EXTRACT_MBC (&b[beg*4])) + c1 = EXTRACT_MBC (&b[beg*4]); + if (c2 < EXTRACT_MBC (&b[end*4 - 2])) + c2 = EXTRACT_MBC (&b[end*4 - 2]); + } + if (end < mbc_size && end != beg + 1) + /* 追加される区間の後ろに既存の区間を移動する. */ + /* NOTE: memcpy() would not work here. */ + bcopy (&b[end*4], &b[(beg + 1)*4], (mbc_size - end)*4); + STORE_MBC (&b[beg*4 + 0], c1); + STORE_MBC (&b[beg*4 + 2], c2); + mbc_size += beg + 1 - end; + STORE_NUMBER (&b[-2], mbc_size); + return REG_NOERROR; +} + +static int +#ifdef __STDC__ +is_in_list (unsigned short c, const unsigned char *b) +#else +is_in_list (c, b) + unsigned short c; + const unsigned char *b; +#endif +{ + unsigned short size; + int in = (re_opcode_t) b[-1] == charset_not; + + size = *b++; + if (c < 1 << BYTEWIDTH) { + if (c / BYTEWIDTH < size && b[c / BYTEWIDTH] & 1 << c % BYTEWIDTH) + in = !in; + } + else { + unsigned short i, j; + + b += size + 2; + size = EXTRACT_UNSIGNED (&b[-2]); + + /* intervals[i] + ●-------● ●--------● + c + ○----------------● + + 上図のような区間のインデックス i を決定する. */ + for (i = 0, j = size; i < j; ) { + unsigned short k = (i + j) >> 1; + + if (c > EXTRACT_MBC (&b[k*4 + 2])) + i = k + 1; + else + j = k; + } + if (i < size && EXTRACT_MBC (&b[i*4]) <= c + /* [...] から, 無効なマルチバイト文字を除外する. ここでは簡単の + ため2バイト目が '\n' または '\0' だけを無効とした. [^...] + の場合は, 逆に無効なマルチバイト文字をマッチさせる. */ + && ((unsigned char) c != '\n' && (unsigned char) c != '\0')) + in = !in; + } + return in; +} + +#endif /* MULTI_BYTE */ #ifndef MATCH_MAY_ALLOCATE /* If we cannot allocate large objects within re_match_2_internal, @@ -2177,12 +2392,21 @@ case '[': { boolean had_char_class = false; +#ifdef MULTI_BYTE + unsigned short c, c1; + int last_char = -1; +#endif /* MULTI_BYTE */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); /* Ensure that we have enough space to push a charset: the opcode, the length count, and the bitset; 34 bytes in all. */ + /* + 2 + 4 for mbcharset(_not)? with just one interval. */ +#ifdef MULTI_BYTE + GET_BUFFER_SPACE (34 + 2 + 4); +#else GET_BUFFER_SPACE (34); +#endif /* MULTI_BYTE */ laststart = b; @@ -2199,7 +2423,11 @@ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ +#ifdef MULTI_BYTE + bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH + 2); +#else bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); +#endif /* MULTI_BYTE */ /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-2] == charset_not @@ -2209,17 +2437,45 @@ /* Read in characters and ranges, setting map bits. */ for (;;) { +#ifdef MULTI_BYTE + int size; +#endif /* MULTI_BYTE */ + if (p == pend) FREE_STACK_RETURN (REG_EBRACK); +#ifdef MULTI_BYTE + if ((size = EXTRACT_UNSIGNED (&b[(1 << BYTEWIDTH) / BYTEWIDTH]))) + /* Ensure the space is enough to hold another interval + of multi-byte chars in charset(_not)?. */ + GET_BUFFER_SPACE (32 + 2 + size*4 + 4); + + PATFETCH_RAW (c); +#else PATFETCH (c); +#endif /* MULTI_BYTE */ /* \ might escape characters inside [...] and [^...]. */ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); +#ifdef MULTI_BYTE + PATFETCH_RAW (c1); + if (ismbchar (c1)) { + unsigned char c2; + + PATFETCH_RAW (c2); + c1 = c1 << 8 | c2; + (void) set_list_bits (c1, c1, syntax, b, translate); + last_char = c1; + continue; + } + SET_LIST_BIT (TRANSLATE (c1)); + last_char = c1; +#else PATFETCH (c1); SET_LIST_BIT (c1); +#endif /* MULTI_BYTE */ continue; } @@ -2234,18 +2490,48 @@ if (had_char_class && c == '-' && *p != ']') FREE_STACK_RETURN (REG_ERANGE); +#ifdef MULTI_BYTE + if (ismbchar (c)) { + unsigned char c2; + + PATFETCH_RAW (c2); + c = c << 8 | c2; + } +#endif /* MULTI_BYTE */ + /* Look ahead to see if it's a range when the last thing was a character: if this is a hyphen not at the beginning or the end of a list, then it's the range operator. */ if (c == '-' +#if 0 /* The original was: */ && !(p - 2 >= pattern && p[-2] == '[') && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') +#else /* I wonder why he did not write like this. + Have we got any problems? */ + && p != p1 + 1 +#endif && *p != ']') { +#ifdef MULTI_BYTE + reg_errcode_t ret; + + assert (last_char >= 0); + PATFETCH_RAW (c1); + if (ismbchar (c1)) { + unsigned char c2; + + PATFETCH_RAW (c2); + c1 = c1 << 8 | c2; + } + ret = set_list_bits (last_char, c1, syntax, b, translate); + last_char = c1; + if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); +#else reg_errcode_t ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); +#endif /* MULTI_BYTE */ } else if (p[0] == '-' && p[1] != ']') @@ -2253,10 +2539,25 @@ reg_errcode_t ret; /* Move past the `-'. */ +#ifdef MULTI_BYTE + PATFETCH_RAW (c1); + + PATFETCH_RAW (c1); + if (ismbchar (c1)) { + unsigned char c2; + + PATFETCH_RAW (c2); + c1 = c1 << 8 | c2; + } + ret = set_list_bits (c, c1, syntax, b, translate); + last_char = c1; + if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); +#else PATFETCH (c1); ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); +#endif /* MULTI_BYTE */ } /* See if we're at the beginning of a possible character @@ -2266,7 +2567,11 @@ { /* Leave room for the null. */ char str[CHAR_CLASS_MAX_LENGTH + 1]; +#ifdef MULTI_BYTE + PATFETCH_RAW (c); +#else PATFETCH (c); +#endif /* MULTI_BYTE */ c1 = 0; /* If pattern is `[[:'. */ @@ -2370,6 +2675,11 @@ SET_LIST_BIT (ch); } had_char_class = true; +#ifdef MULTI_BYTE +#ifdef DEBUG + last_char = -1; +#endif +#endif /* MULTI_BYTE */ #endif /* libc || wctype.h */ } else @@ -2377,15 +2687,28 @@ c1++; while (c1--) PATUNFETCH; +#if 0 /* The original was: */ SET_LIST_BIT ('['); SET_LIST_BIT (':'); +#else /* I think this is the right way. */ + SET_LIST_BIT (TRANSLATE ('[')); + SET_LIST_BIT (TRANSLATE (':')); +#endif had_char_class = false; +#ifdef MULTI_BYTE + last_char = ':'; +#endif /* MULTI_BYTE */ } } else { had_char_class = false; +#ifdef MULTI_BYTE + (void) set_list_bits (c, c, syntax, b, translate); + last_char = c; +#else SET_LIST_BIT (c); +#endif /* MULTI_BYTE */ } } @@ -2393,7 +2716,14 @@ end of the map. Decrease the map-length byte too. */ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; +#ifdef MULTI_BYTE + if (b[-1] != (1 << BYTEWIDTH) / BYTEWIDTH) + bcopy (&b[(1 << BYTEWIDTH) / BYTEWIDTH], &b[b[-1]], + 2 + EXTRACT_UNSIGNED (&b[(1 << BYTEWIDTH) / BYTEWIDTH])*4); + b += b[-1] + 2 + EXTRACT_UNSIGNED (&b[b[-1]])*4; +#else b += b[-1]; +#endif /* MULTI_BYTE */ } break; @@ -2880,7 +3210,12 @@ /* You might think it would be useful for \ to mean not to translate; but if we don't translate it it will never match anything. */ +#ifdef MULTI_BYTE + if (!ismbchar (c)) + c = TRANSLATE (c); +#else c = TRANSLATE (c); +#endif /* MULTI_BYTE */ goto normal_char; } break; @@ -2889,6 +3224,14 @@ default: /* Expects the character in `c'. */ normal_char: + +#ifdef MULTI_BYTE + c1 = 0; + if (ismbchar (c)) { + c1 = c; + PATFETCH_RAW (c); + } +#endif /* MULTI_BYTE */ /* If no exactn currently being built. */ if (!pending_exact @@ -2896,7 +3239,12 @@ || pending_exact + *pending_exact + 1 != b /* We have only one byte following the exactn for the count. */ +#ifdef MULTI_BYTE + || *pending_exact >= (c1 ? (1 << BYTEWIDTH) - 2 + : (1 << BYTEWIDTH) - 1) +#else || *pending_exact == (1 << BYTEWIDTH) - 1 +#endif /* MULTI_BYTE */ /* If followed by a repetition operator. */ || *p == '*' || *p == '^' @@ -2916,6 +3264,12 @@ pending_exact = b - 1; } +#ifdef MULTI_BYTE + if (c1) { + BUF_PUSH (c1); + (*pending_exact)++; + } +#endif /* MULTI_BYTE */ BUF_PUSH (c); (*pending_exact)++; break; @@ -3123,6 +3477,7 @@ } +#ifndef MULTI_BYTE /* We use set_list_bits() now. */ /* Read the ending character of a range (in a bracket expression) from the uncompiled pattern *P_PTR (which ends at PEND). We assume the starting character is in `P[-2]'. (`P[-1]' is the character `-'.) @@ -3179,6 +3534,7 @@ return ret; } +#endif /* MULTI_BYTE */ /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible @@ -3277,20 +3633,83 @@ case charset: +#ifdef MULTI_BYTE + /* NOTE: Charset for single-byte chars never contain + multi-byte char. See set_list_bits(). */ +#endif /* MULTI_BYTE */ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) fastmap[j] = 1; +#ifdef MULTI_BYTE + { + unsigned short size; + unsigned char c, end; + + p += p[-1] + 2; + size = EXTRACT_UNSIGNED (&p[-2]); + for (j = 0; j < size; j++) + /* set bits for 1st bytes of multi-byte chars. */ + for (c = (unsigned char) p[j*4], + end = (unsigned char) p[j*4 + 2]; + c <= end; c++) + /* NOTE: Charset for multi-byte chars might contain + single-byte chars. We must reject them. */ + if (ismbchar (c)) + fastmap[c] = 1; + } +#endif /* MULTI_BYTE */ break; case charset_not: +#ifdef MULTI_BYTE + /* S: set of all single-byte chars. + M: set of all first bytes that can start multi-byte chars. + s: any set of single-byte chars. + m: any set of first bytes that can start multi-byte chars. + + We assume S+M = U. + ___ _ _ + s+m = (S*s+M*m). */ +#endif /* MULTI_BYTE */ /* Chars beyond end of map must be allowed. */ +#ifdef MULTI_BYTE + /* NOTE: Charset_not for single-byte chars might contain + multi-byte chars. See set_list_bits(). */ +#endif /* MULTI_BYTE */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) +#ifdef MULTI_BYTE + if (!ismbchar (j)) + fastmap[j] = 1; +#else fastmap[j] = 1; +#endif /* MULTI_BYTE */ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) +#ifdef MULTI_BYTE + if (!ismbchar (j)) + fastmap[j] = 1; + { + unsigned short size; + unsigned short c, beg; + + p += p[-1] + 2; + size = EXTRACT_UNSIGNED (&p[-2]); + c = 0x00; + for (j = 0; j < size; j++) { + for (beg = (unsigned char) p[j*4 + 0]; c <= beg; c++) + if (ismbchar (c)) + fastmap[c] = 1; + c = (unsigned char) p[j*4 + 2]; + } + for (beg = 0xff; c <= beg; c++) + if (ismbchar (c)) + fastmap[c] = 1; + } +#else fastmap[j] = 1; +#endif /* MULTI_BYTE */ break; @@ -3637,6 +4056,9 @@ register const char *d; register int lim = 0; int irange = range; +#ifdef MULTI_BYTE + unsigned char c; +#endif /* MULTI_BYTE */ if (startpos < size1 && startpos + range >= size1) lim = range - (size1 - startpos); @@ -3646,13 +4068,37 @@ /* Written out as an if-else to avoid testing `translate' inside the loop. */ if (translate) +#ifdef MULTI_BYTE + while (range > lim) { + c = *d++; + if (ismbchar (c)) { + if (fastmap[c]) + break; + d++; + range -= 2; + continue; + } + if (fastmap[(unsigned char) translate[c]]) + break; + range--; + } +#else while (range > lim && !fastmap[(unsigned char) translate[(unsigned char) *d++]]) range--; +#endif /* MULTI_BYTE */ else +#ifdef MULTI_BYTE + while (range > lim && (c = *d++, !fastmap[c])) { + if (ismbchar (c)) + d++, range--; + range--; + } +#else while (range > lim && !fastmap[(unsigned char) *d++]) range--; +#endif /* MULTI_BYTE */ startpos += irange - range; } @@ -3691,13 +4137,44 @@ break; else if (range > 0) { +#ifdef MULTI_BYTE + const char *d = ((startpos >= size1 ? string2 - size1 : string1) + + startpos); + + if (ismbchar (*d)) { +#endif /* MULTI_BYTE */ range--; startpos++; +#ifdef MULTI_BYTE + if (!range) + break; + } + range--, startpos++; +#endif /* MULTI_BYTE */ } else { range++; startpos--; +#ifdef MULTI_BYTE + { + const char *s, *d, *p; + + if (startpos < size1) + s = string1, d = string1 + startpos; + else + s = string2, d = string2 + startpos - size1; + for (p = d; p-- > s && ismbchar(*p); ) + /* --p >= s だと 80[12]?86 で動かない可能性がある. (huge + model 以外で, s のオフセットが 0 だった場合.) */ + ; + if (!((d - p) & 1)) { + if (!range) + break; + range++, startpos--; + } + } +#endif /* MULTI_BYTE */ } } return -1; @@ -4297,10 +4774,30 @@ { do { +#ifdef MULTI_BYTE + unsigned char c; +#endif /* MULTI_BYTE */ + PREFETCH (); +#ifdef MULTI_BYTE + c = *d++; + if (ismbchar (c)) { + if (c != (unsigned char) *p++ + || !--mcnt /* パターンが正しくコンパイルさ + れている限り, このチェックは + 冗長だが念のため. */ + || d == dend + || (unsigned char) *d++ != (unsigned char) *p++) + goto fail; + continue; + } + if ((unsigned char) translate[c] != (unsigned char) *p++) + goto fail; +#else if ((unsigned char) translate[(unsigned char) *d++] != (unsigned char) *p++) goto fail; +#endif /* MULTI_BYTE */ } while (--mcnt); } @@ -4308,8 +4805,34 @@ { do { +#ifdef MULTI_BYTE +#if 0 + /* 他の部分では, string1 と string2 にマルチバイト文字 + が跨るのを許していない. このことを速度を犠牲にして + もチェックする場合は, ここと次の `#if 0' を `#if 1' + に変えること. */ + unsigned char c; + +#endif +#endif /* MULTI_BYTE */ PREFETCH (); +#ifdef MULTI_BYTE +#if 0 + c = *d++; + if (ismbchar (c)) { + if (c != (unsigned char) *p++ + || !--mcnt + || d == dend) + goto fail; + c = *d++; + } + if (c != (unsigned char) *p++) goto fail; +#else + if (*d++ != (char) *p++) goto fail; +#endif +#else if (*d++ != (char) *p++) goto fail; +#endif /* MULTI_BYTE */ } while (--mcnt); } @@ -4322,6 +4845,18 @@ DEBUG_PRINT1 ("EXECUTING anychar.\n"); PREFETCH (); +#ifdef MULTI_BYTE + if (ismbchar (*d)) { + if (d + 1 == dend || d[1] == '\n' || d[1] == '\0') + /* 無効なマルチバイト文字にはマッチさせない. ここでは, 簡 + 単のため2バイト目が '\n', '\0' のものだけを無効とする. */ + goto fail; + SET_REGS_MATCHED (); + DEBUG_PRINT2 (" Matched `%d'.\n", EXTRACT_MBC (&d[0])); + d += 2; + break; + } +#endif /* MULTI_BYTE */ if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) @@ -4336,12 +4871,30 @@ case charset: case charset_not: { +#ifdef MULTI_BYTE + register unsigned short c; +#else register unsigned char c; +#endif /* MULTI_BYTE */ boolean not = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); PREFETCH (); +#ifdef MULTI_BYTE + c = (unsigned char) *d; + if (ismbchar (c)) { + c <<= 8; + if (d + 1 != dend) + c |= (unsigned char) d[1]; + } + else + c = TRANSLATE (c); /* The character to match. */ + + not = is_in_list (c, p); + + p += 1 + *p + 2 + EXTRACT_UNSIGNED (&p[1 + *p])*4; +#else c = TRANSLATE (*d); /* The character to match. */ /* Cast to `unsigned' instead of `unsigned char' in case the @@ -4351,11 +4904,16 @@ not = !not; p += 1 + *p; +#endif /* MULTI_BYTE */ if (!not) goto fail; SET_REGS_MATCHED (); d++; +#ifdef MULTI_BYTE + if (d != dend && c >= 1 << BYTEWIDTH) + d++; +#endif /* MULTI_BYTE */ break; } @@ -4808,7 +5366,11 @@ else if ((re_opcode_t) *p2 == exactn || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) { +#ifdef MULTI_BYTE + register unsigned short c +#else register unsigned char c +#endif /* MULTI_BYTE */ = *p2 == (unsigned char) endline ? '\n' : p2[2]; if ((re_opcode_t) p1[3] == exactn && p1[5] != c) @@ -4821,6 +5383,14 @@ else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { +#ifdef MULTI_BYTE + if (ismbchar (c)) + c = c << 8 | p2[3]; + + /* `is_in_list()' is TRUE if c would match, which means + that we can't change to pop_failure_jump. */ + if (!is_in_list (c, p1 + 4)) +#else int not = (re_opcode_t) p1[3] == charset_not; if (c < (unsigned char) (p1[4] * BYTEWIDTH) @@ -4830,6 +5400,7 @@ /* `not' is equal to 1 if c would match, which means that we can't change to pop_failure_jump. */ if (!not) +#endif /* MULTI_BYTE */ { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); @@ -4840,16 +5411,34 @@ { /* We win if the first character of the loop is not part of the charset. */ +#ifdef MULTI_BYTE + if ((re_opcode_t) p1[3] == exactn) { + register unsigned short c = p1[5]; + + if (ismbchar (c)) + c = c << 8 | p1[6]; + + if (!is_in_list (c, p2 + 1)) +#else if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] && (p2[2 + p1[5] / BYTEWIDTH] & (1 << (p1[5] % BYTEWIDTH))))) +#endif { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } - +#ifdef MULTI_BYTE + } +#endif +#ifdef MULTI_BYTE + else if ((re_opcode_t) p1[3] == charset_not + && EXTRACT_UNSIGNED (&p2[2 + *(p2+1)]) == 0 + && EXTRACT_UNSIGNED (&p1[5 + *(p1+4)]) == 0) +#else else if ((re_opcode_t) p1[3] == charset_not) +#endif { int idx; /* We win if the charset_not inside the loop @@ -4866,7 +5455,13 @@ DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } +#ifdef MULTI_BYTE + else if ((re_opcode_t) p1[3] == charset + && EXTRACT_UNSIGNED (&p2[2 + *(p2+1)]) == 0 + && EXTRACT_UNSIGNED (&p1[5 + *(p1+4)]) == 0) +#else else if ((re_opcode_t) p1[3] == charset) +#endif { int idx; /* We win if the charset inside the loop @@ -5494,9 +6089,24 @@ { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; +#ifdef MULTI_BYTE + unsigned char c; +#endif /* MULTI_BYTE */ + while (len) { +#ifdef MULTI_BYTE + c = *p1++; + if (ismbchar(c)) { + if (c != *p2++ || !--len || *p1++ != *p2++) + return 1; + } + else + if (translate[c] != translate[*p2++]) + return 1; +#else if (translate[*p1++] != translate[*p2++]) return 1; +#endif /* MULTI_BYTE */ len--; } return 0; diff -ruN grep-2.4.2.orig/src/search.c grep-2.4.2/src/search.c --- grep-2.4.2.orig/src/search.c Wed Feb 2 14:49:07 2000 +++ grep-2.4.2/src/search.c Fri Oct 13 23:26:56 2000 @@ -17,6 +17,8 @@ 02111-1307, USA. */ /* Written August 1992 by Mike Haertel. */ +/* Multi-byte extension added Jul., 1993 by t^2 (Takahiro Tanimoto) + Last change: Jul. 9, 1993 by t^2 */ #ifdef HAVE_CONFIG_H # include @@ -27,6 +29,9 @@ #include "regex.h" #include "dfa.h" #include "kwset.h" +#ifdef MULTI_BYTE +#include "mbc.h" +#endif /* MULTI_BYTE */ #define NCHAR (UCHAR_MAX + 1) @@ -373,10 +378,16 @@ Fexecute (char *buf, size_t size, char **endp) { register char *beg, *try, *end; +#ifdef MULTI_BYTE + register char *p, *lim; +#endif /* MULTI_BYTE */ register size_t len; char eol = eolbyte; struct kwsmatch kwsmatch; +#ifdef MULTI_BYTE + lim = buf; +#endif /* MULTI_BYTE */ for (beg = buf; beg <= buf + size; ++beg) { if (!(beg = kwsexec(kwset, beg, buf + size - beg, &kwsmatch))) @@ -395,6 +406,12 @@ { if (try > buf && WCHAR((unsigned char) try[-1])) break; +#ifdef MULTI_BYTE + for (p = try; p-- > lim && ismbchar(*p); ) + ; + if (!((try - p) & 1)) + break; +#endif /* MULTI_BYTE */ if (try + len < buf + size && WCHAR((unsigned char) try[len])) { try = kwsexec(kwset, beg, --len, &kwsmatch); @@ -404,7 +421,18 @@ goto success; } else +#ifdef MULTI_BYTE + { + for (p = beg; p-- > lim && ismbchar(*p); ) + ; + if ((beg - p) & 1) + goto success; + if (lim + 1 < beg) + lim = beg - 1; + } +#else goto success; +#endif /* MULTI_BYTE */ } return 0; diff -ruN grep-2.4.2.orig/tests/Makefile.in grep-2.4.2/tests/Makefile.in --- grep-2.4.2.orig/tests/Makefile.in Thu Mar 9 13:53:04 2000 +++ grep-2.4.2/tests/Makefile.in Tue Oct 31 13:30:58 2000 @@ -78,6 +78,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -130,7 +131,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff -ruN grep-2.4.2.orig/vms/Makefile.in grep-2.4.2/vms/Makefile.in --- grep-2.4.2.orig/vms/Makefile.in Thu Mar 9 13:51:05 2000 +++ grep-2.4.2/vms/Makefile.in Tue Oct 31 13:30:29 2000 @@ -79,6 +79,7 @@ INTLOBJS = @INTLOBJS@ LIBOBJS = @LIBOBJS@ MAKEINFO = @MAKEINFO@ +MBCTYPE_DEF = @MBCTYPE_DEF@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ @@ -126,7 +127,7 @@ @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \