From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Lorenz To: development@lists.ipfire.org Subject: [PATCH] diffutils: update to 3.3 v2 Date: Sat, 28 May 2016 21:07:15 +0200 Message-ID: <1464462435-31822-1-git-send-email-marcel.lorenz@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3559663381574588428==" List-Id: --===============3559663381574588428== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Marcel Lorenz --- config/rootfiles/common/diffutils | 11 +- lfs/diffutils | 12 +- src/patches/diffutils-2.8.1-i18n-1.patch | 802 -----------------------------= -- 3 files changed, 8 insertions(+), 817 deletions(-) delete mode 100644 src/patches/diffutils-2.8.1-i18n-1.patch diff --git a/config/rootfiles/common/diffutils b/config/rootfiles/common/diff= utils index b00abdb..bb02f1b 100644 --- a/config/rootfiles/common/diffutils +++ b/config/rootfiles/common/diffutils @@ -2,10 +2,7 @@ usr/bin/cmp usr/bin/diff #usr/bin/diff3 #usr/bin/sdiff -#usr/info -#usr/info/diff.info -#usr/info/dir -#usr/man/man1/cmp.1 -#usr/man/man1/diff.1 -#usr/man/man1/diff3.1 -#usr/man/man1/sdiff.1 +#usr/share/info/diffutils.info +#usr/share/man/man1/cmp.1 +#usr/share/man/man1/diff3.1 +#usr/share/man/man1/sdiff.1 diff --git a/lfs/diffutils b/lfs/diffutils index 3e96c67..a89ac71 100644 --- a/lfs/diffutils +++ b/lfs/diffutils @@ -24,10 +24,10 @@ =20 include Config =20 -VER =3D 2.8.1 +VER =3D 3.3 =20 THISAPP =3D diffutils-$(VER) -DL_FILE =3D $(THISAPP).tar.gz +DL_FILE =3D $(THISAPP).tar.xz DL_FROM =3D $(URL_IPFIRE) DIR_APP =3D $(DIR_SRC)/$(THISAPP) =20 @@ -53,7 +53,7 @@ objects =3D $(DL_FILE) =20 $(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) =20 -$(DL_FILE)_MD5 =3D 71f9c5ae19b60608f6c7f162da86a428 +$(DL_FILE)_MD5 =3D 99180208ec2a82ce71f55b0d7389f1b3 =20 install : $(TARGET) =20 @@ -82,11 +82,7 @@ $(subst %,%_MD5,$(objects)) : =20 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) - @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) -ifeq "$(ROOT)" "" - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-i18n-1.patch - cd $(DIR_APP) && touch man/diff.1 -endif + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && ./configure $(EXTRA_CONFIG) cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) cd $(DIR_APP) && make $(EXTRA_INSTALL) install diff --git a/src/patches/diffutils-2.8.1-i18n-1.patch b/src/patches/diffutils= -2.8.1-i18n-1.patch deleted file mode 100644 index 488885b..0000000 --- a/src/patches/diffutils-2.8.1-i18n-1.patch +++ /dev/null @@ -1,802 +0,0 @@ -Submitted by: Alexander E. Patrakov -Date: 2005-08-13 -Initial Package Version: 2.8.1 -Upstream Status: Unknown, but required for LSB >=3D 2.0 certification -Origin: RedHat -Description: Fixes treatment of whitespace in multibyte locales. - ---- diffutils-2.8.4/src/diff.c.i18n 2002-06-17 01:55:42.000000000 -0400 -+++ diffutils-2.8.4/src/diff.c 2002-11-16 18:41:37.000000000 -0500 -@@ -275,6 +275,13 @@ - re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING); - excluded =3D new_exclude (); -=20 -+#ifdef HANDLE_MULTIBYTE -+ if (MB_CUR_MAX > 1) -+ lines_differ =3D lines_differ_multibyte; -+ else -+#endif -+ lines_differ =3D lines_differ_singlebyte; -+ - /* Decode the options. */ -=20 - while ((c =3D getopt_long (argc, argv, shortopts, longopts, 0)) !=3D -1) ---- diffutils-2.8.4/src/diff.h.i18n 2002-11-16 18:31:32.000000000 -0500 -+++ diffutils-2.8.4/src/diff.h 2002-11-16 18:48:58.000000000 -0500 -@@ -23,6 +23,19 @@ - #include "system.h" - #include -=20 -+/* For platform which support the ISO C amendement 1 functionality we -+ support user defined character classes. */ -+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H -+/* Solaris 2.5 has a bug: must be included before . */ -+# include -+# include -+# if defined (HAVE_MBRTOWC) -+# define HANDLE_MULTIBYTE 1 -+# endif -+#endif -+ -+#define TAB_WIDTH 8 -+ - /* What kind of changes a hunk contains. */ - enum changes - { -@@ -350,7 +363,13 @@ - extern char const pr_program[]; - char *concat (char const *, char const *, char const *); - char *dir_file_pathname (char const *, char const *); --bool lines_differ (char const *, char const *); -+ -+bool (*lines_differ) (char const *, char const *); -+bool lines_differ_singlebyte (char const *, char const *); -+#ifdef HANDLE_MULTIBYTE -+bool lines_differ_multibyte (char const *, char const *); -+#endif -+ - lin translate_line_number (struct file_data const *, lin); - struct change *find_change (struct change *); - struct change *find_reverse_change (struct change *); ---- diffutils-2.8.4/src/io.c.i18n 2002-06-11 02:06:32.000000000 -0400 -+++ diffutils-2.8.4/src/io.c 2002-11-16 18:57:30.000000000 -0500 -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include -=20 - /* Rotate an unsigned value to the left. */ - #define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n))) -@@ -213,6 +214,28 @@ - =0C - /* Split the file into lines, simultaneously computing the equivalence - class for each line. */ -+#ifdef HANDLE_MULTIBYTE -+# define MBC2WC(P, END, MBLENGTH, WC, STATE, CONVFAIL) \ -+do \ -+{ \ -+ mbstate_t state_bak =3D STATE; \ -+ \ -+ CONVFAIL =3D 0; \ -+ MBLENGTH =3D mbrtowc (&WC, P, END - (char const *)P, &STATE); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-2: \ -+ case (size_t)-1: \ -+ STATE =3D state_bak; \ -+ ++CONVFAIL; \ -+ /* Fall through. */ \ -+ case 0: \ -+ MBLENGTH =3D 1; \ -+ } \ -+} \ -+while (0) -+#endif -=20 - static void - find_and_hash_each_line (struct file_data *current) -@@ -239,12 +262,280 @@ - bool same_length_diff_contents_compare_anyway =3D - diff_length_compare_anyway | ignore_case; -=20 -+#ifdef HANDLE_MULTIBYTE -+ wchar_t wc; -+ size_t mblength; -+ mbstate_t state; -+ int convfail; -+ =20 -+ memset (&state, '\0', sizeof (mbstate_t)); -+#endif -+ - while ((char const *) p < suffix_begin) - { - char const *ip =3D (char const *) p; -=20 - h =3D 0; -+#ifdef HANDLE_MULTIBYTE -+ if (MB_CUR_MAX > 1) -+ { -+ wchar_t lo_wc; -+ char mbc[MB_LEN_MAX]; -+ mbstate_t state_wc; -+ -+ /* Hash this line until we find a newline. */ -+ switch (ignore_white_space) -+ { -+ case IGNORE_ALL_SPACE: -+ while (1) -+ { -+ if (*p =3D=3D '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (convfail) -+ mbc[0] =3D *p++; -+ else if (!iswspace (wc)) -+ { -+ bool flag =3D 0; -+ -+ if (ignore_case) -+ { -+ lo_wc =3D towlower (wc); -+ if (lo_wc !=3D wc) -+ { -+ flag =3D 1; -+ -+ p +=3D mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength =3D wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength !=3D (size_t)-1 && -+ mblength !=3D (size_t)-2); -+ -+ mblength =3D (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i =3D 0; i < mblength; i++) -+ mbc[i] =3D *p++; -+ } -+ } -+ else -+ { -+ p +=3D mblength; -+ continue; -+ } -+ -+ for (i =3D 0; i < mblength; i++) -+ h =3D HASH (h, mbc[i]); -+ } -+ break; -+ -+ case IGNORE_SPACE_CHANGE: -+ while (1) -+ { -+ if (*p =3D=3D '\n') -+ { -+ ++p; -+ break; -+ } -=20 -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (!convfail && iswspace (wc)) -+ { -+ while (1) -+ { -+ if (*p =3D=3D '\n') -+ { -+ ++p; -+ goto hashing_done; -+ } -+ -+ p +=3D mblength; -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ if (convfail || (!convfail && !iswspace (wc))) -+ break; -+ } -+ h =3D HASH (h, ' '); -+ } -+ -+ /* WC is now the first non-space. */ -+ if (convfail) -+ mbc[0] =3D *p++; -+ else -+ { -+ bool flag =3D 0; -+ -+ if (ignore_case) -+ { -+ lo_wc =3D towlower (wc); -+ if (lo_wc !=3D wc) -+ { -+ flag =3D 1; -+ -+ p +=3D mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength =3D wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength !=3D (size_t)-1 && -+ mblength !=3D (size_t)-2); -+ -+ mblength =3D (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i =3D 0; i < mblength; i++) -+ mbc[i] =3D *p++; -+ } -+ } -+ -+ for (i =3D 0; i < mblength; i++) -+ h =3D HASH (h, mbc[i]); -+ } -+ break; -+ -+ case IGNORE_TAB_EXPANSION: -+ { -+ size_t column =3D 0; -+ -+ while (1) -+ { -+ if (*p =3D=3D '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (convfail) -+ { -+ h =3D HASH (h, *p++); -+ ++column; -+ } -+ else -+ { -+ bool flag; -+ -+ switch (wc) -+ { -+ case L'\b': -+ column -=3D 0 < column; -+ h =3D HASH (h, '\b'); -+ ++p; -+ break; -+ -+ case L'\t': -+ { -+ int repetitions; -+ -+ repetitions =3D TAB_WIDTH - column % TAB_WIDTH; -+ column +=3D repetitions; -+ do -+ h =3D HASH (h, ' '); -+ while (--repetitions !=3D 0); -+ ++p; -+ } -+ break; -+ -+ case L'\r': -+ column =3D 0; -+ h =3D HASH (h, '\r'); -+ ++p; -+ break; -+ -+ default: -+ flag =3D 0; -+ column +=3D wcwidth (wc); -+ if (ignore_case) -+ { -+ lo_wc =3D towlower (wc); -+ if (lo_wc !=3D wc) -+ { -+ flag =3D 1; -+ p +=3D mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength =3D wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength !=3D (size_t)-1 && -+ mblength !=3D (size_t)-2); -+ -+ mblength =3D (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i =3D 0; i < mblength; i++) -+ mbc[i] =3D *p++; -+ } -+ -+ for (i =3D 0; i < mblength; i++) -+ h =3D HASH (h, mbc[i]); -+ } -+ } -+ } -+ } -+ break; -+ -+ default: -+ while (1) -+ { -+ if (*p =3D=3D '\n') -+ { -+ ++p; -+ break; -+ } -+ -+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail); -+ -+ if (convfail) -+ mbc[0] =3D *p++; -+ else -+ { -+ int flag =3D 0; -+ -+ if (ignore_case) -+ { -+ lo_wc =3D towlower (wc); -+ if (lo_wc !=3D wc) -+ { -+ flag =3D 1; -+ p +=3D mblength; -+ memset (&state_wc, '\0', sizeof(mbstate_t)); -+ mblength =3D wcrtomb (mbc, lo_wc, &state_wc); -+ -+ assert (mblength !=3D (size_t)-1 && -+ mblength !=3D (size_t)-2); -+ -+ mblength =3D (mblength < 1) ? 1 : mblength; -+ } -+ } -+ -+ if (!flag) -+ { -+ for (i =3D 0; i < mblength; i++) -+ mbc[i] =3D *p++; -+ } -+ } -+ -+ for (i =3D 0; i < mblength; i++) -+ h =3D HASH (h, mbc[i]); -+ } -+ } -+ } -+ else -+#endif - /* Hash this line until we find a newline. */ - if (ignore_case) - switch (ignore_white_space) ---- diffutils-2.8.4/src/side.c.i18n 2002-06-11 02:06:32.000000000 -0400 -+++ diffutils-2.8.4/src/side.c 2002-11-16 18:41:37.000000000 -0500 -@@ -73,11 +73,72 @@ - register size_t out_position =3D 0; - register char const *text_pointer =3D line[0]; - register char const *text_limit =3D line[1]; -+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H -+ unsigned char mbc[MB_LEN_MAX]; -+ wchar_t wc; -+ mbstate_t state, state_bak; -+ size_t mbc_pos, mblength; -+ int mbc_loading_flag =3D 0; -+ int wc_width; -+ -+ memset (&state, '\0', sizeof (mbstate_t)); -+#endif -=20 - while (text_pointer < text_limit) - { - register unsigned char c =3D *text_pointer++; -=20 -+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H -+ if (MB_CUR_MAX > 1 && mbc_loading_flag) -+ { -+ mbc_loading_flag =3D 0; -+ state_bak =3D state; -+ mbc[mbc_pos++] =3D c; -+ -+process_mbc: -+ mblength =3D mbrtowc (&wc, mbc, mbc_pos, &state); -+ -+ switch (mblength) -+ { -+ case (size_t)-2: /* Incomplete multibyte character. */ -+ mbc_loading_flag =3D 1; -+ state =3D state_bak; -+ break; -+ -+ case (size_t)-1: /* Invalid as a multibyte character. */ -+ if (in_position++ < out_bound) -+ { -+ out_position =3D in_position; -+ putc (mbc[0], out); -+ } -+ memmove (mbc, mbc + 1, --mbc_pos); -+ if (mbc_pos > 0) -+ { -+ mbc[mbc_pos] =3D '\0'; -+ goto process_mbc; -+ } -+ break; -+ -+ default: -+ wc_width =3D wcwidth (wc); -+ if (wc_width < 1) /* Unprintable multibyte character. */ -+ { -+ if (in_position <=3D out_bound) -+ fprintf (out, "%lc", (wint_t)wc); -+ } -+ else /* Printable multibyte character. */ -+ { -+ in_position +=3D wc_width; -+ if (in_position <=3D out_bound) -+ { -+ out_position =3D in_position; -+ fprintf (out, "%lc", (wint_t)wc); -+ } -+ } -+ } -+ continue; -+ } -+#endif - switch (c) - { - case '\t': -@@ -135,8 +196,39 @@ - break; -=20 - default: -- if (! ISPRINT (c)) -- goto control_char; -+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H -+ if (MB_CUR_MAX > 1) -+ { -+ memset (mbc, '\0', MB_LEN_MAX); -+ mbc_pos =3D 0; -+ mbc[mbc_pos++] =3D c; -+ state_bak =3D state; -+ -+ mblength =3D mbrtowc (&wc, mbc, mbc_pos, &state); -+ -+ /* The value of mblength is always less than 2 here. */ -+ switch (mblength) -+ { -+ case (size_t)-2: /* Incomplete multibyte character. */ -+ state =3D state_bak; -+ mbc_loading_flag =3D 1; -+ continue; -+ -+ case (size_t)-1: /* Invalid as a multibyte character. */ -+ state =3D state_bak; -+ break; -+ -+ default: -+ if (! iswprint (wc)) -+ goto control_char; -+ } -+ } -+ else -+#endif -+ { -+ if (! ISPRINT (c)) -+ goto control_char; -+ } - /* falls through */ - case ' ': - if (in_position++ < out_bound) ---- diffutils-2.8.4/src/util.c.i18n 2002-06-11 02:06:32.000000000 -0400 -+++ diffutils-2.8.4/src/util.c 2002-11-16 18:41:37.000000000 -0500 -@@ -321,7 +321,7 @@ - Return nonzero if the lines differ. */ -=20 - bool --lines_differ (char const *s1, char const *s2) -+lines_differ_singlebyte (char const *s1, char const *s2) - { - register unsigned char const *t1 =3D (unsigned char const *) s1; - register unsigned char const *t2 =3D (unsigned char const *) s2; -@@ -450,6 +450,293 @@ -=20 - return 1; - } -+ -+#ifdef HANDLE_MULTIBYTE -+# define MBC2WC(T, END, MBLENGTH, WC, STATE, CONVFAIL) \ -+do \ -+{ \ -+ mbstate_t bak =3D STATE; \ -+ \ -+ CONVFAIL =3D 0; \ -+ MBLENGTH =3D mbrtowc (&WC, T, END - T, &STATE); \ -+ \ -+ switch (MBLENGTH) \ -+ { \ -+ case (size_t)-2: \ -+ case (size_t)-1: \ -+ STATE =3D bak; \ -+ ++CONVFAIL; \ -+ /* Fall through. */ \ -+ case 0: \ -+ MBLENGTH =3D 1; \ -+ } \ -+} \ -+while (0) -+ -+bool -+lines_differ_multibyte (char const *s1, char const *s2) -+{ -+ unsigned char const *end1, *end2; -+ unsigned char c1, c2; -+ wchar_t wc1, wc2, wc1_bak, wc2_bak; -+ size_t mblen1, mblen2; -+ mbstate_t state1, state2, state1_bak, state2_bak; -+ int convfail1, convfail2, convfail1_bak, convfail2_bak; -+ =20 -+ unsigned char const *t1 =3D (unsigned char const *) s1; -+ unsigned char const *t2 =3D (unsigned char const *) s2; -+ unsigned char const *t1_bak, *t2_bak; -+ size_t column =3D 0; -+ -+ if (ignore_white_space =3D=3D IGNORE_NO_WHITE_SPACE && !ignore_case) -+ { -+ while (*t1 !=3D '\n') -+ if (*t1++ !=3D * t2++) -+ return 1; -+ return 0; -+ } -+ -+ memset (&state1, '\0', sizeof (mbstate_t)); -+ memset (&state2, '\0', sizeof (mbstate_t)); -+ -+ end1 =3D s1 + strlen (s1); -+ end2 =3D s2 + strlen (s2); -+ -+ while (1) -+ { -+ c1 =3D *t1; -+ c2 =3D *t2; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ -+ /* Test for exact char equality first, since it's a common case. */ -+ if (convfail1 ^ convfail2) -+ break; -+ else if (convfail1 && convfail2 && c1 !=3D c2) -+ break; -+ else if (!convfail1 && !convfail2 && wc1 !=3D wc2) -+ { -+ switch (ignore_white_space) -+ { -+ case IGNORE_ALL_SPACE: -+ /* For -w, just skip past any white space. */ -+ while (1) -+ { -+ if (convfail1) -+ break; -+ else if (wc1 =3D=3D L'\n' || !iswspace (wc1)) -+ break; -+ -+ t1 +=3D mblen1; -+ c1 =3D *t1; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ } -+ -+ while (1) -+ { -+ if (convfail2) -+ break; -+ else if (wc2 =3D=3D L'\n' || !iswspace (wc2)) -+ break; -+ -+ t2 +=3D mblen2; -+ c2 =3D *t2; -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ } -+ t1 +=3D mblen1; -+ t2 +=3D mblen2; -+ break; -+ -+ case IGNORE_SPACE_CHANGE: -+ /* For -b, advance past any sequence of white space in -+ line 1 and consider it just one space, or nothing at -+ all if it is at the end of the line. */ -+ if (wc1 !=3D L'\n' && iswspace (wc1)) -+ { -+ size_t mblen_bak; -+ mbstate_t state_bak; -+ -+ do -+ { -+ t1 +=3D mblen1; -+ mblen_bak =3D mblen1; -+ state_bak =3D state1; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ } -+ while (!convfail1 && (wc1 !=3D L'\n' && iswspace (wc1))); -+ -+ state1 =3D state_bak; -+ mblen1 =3D mblen_bak; -+ t1 -=3D mblen1; -+ convfail1 =3D 0; -+ wc1 =3D L' '; -+ } -+ -+ /* Likewise for line 2. */ -+ if (wc2 !=3D L'\n' && iswspace (wc2)) -+ { -+ size_t mblen_bak; -+ mbstate_t state_bak; -+ -+ do -+ { -+ t2 +=3D mblen2; -+ mblen_bak =3D mblen2; -+ state_bak =3D state2; -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ } -+ while (!convfail2 && (wc2 !=3D L'\n' && iswspace (wc2))); -+ -+ state2 =3D state_bak; -+ mblen2 =3D mblen_bak; -+ t2 -=3D mblen2; -+ convfail2 =3D 0; -+ wc2 =3D L' '; -+ } -+ -+ if (wc1 !=3D wc2) -+ { -+ if (wc2 =3D=3D L' ' && wc1 !=3D L'\n' && -+ t1 > (unsigned char const *)s1 && -+ !convfail1_bak && iswspace (wc1_bak)) -+ { -+ t1 =3D t1_bak; -+ wc1 =3D wc1_bak; -+ state1 =3D state1_bak; -+ convfail1 =3D convfail1_bak; -+ continue; -+ } -+ if (wc1 =3D=3D L' ' && wc2 !=3D L'\n' -+ && t2 > (unsigned char const *)s2 -+ && !convfail2_bak && iswspace (wc2_bak)) -+ { -+ t2 =3D t2_bak; -+ wc2 =3D wc2_bak; -+ state2 =3D state2_bak; -+ convfail2 =3D convfail2_bak; -+ continue; -+ } -+ } -+ -+ t1_bak =3D t1; t2_bak =3D t2; -+ wc1_bak =3D wc1; wc2_bak =3D wc2; -+ state1_bak =3D state1; state2_bak =3D state2; -+ convfail1_bak =3D convfail1; convfail2_bak =3D convfail2; -+ -+ if (wc1 =3D=3D L'\n') -+ wc1 =3D L' '; -+ else -+ t1 +=3D mblen1; -+ -+ if (wc2 =3D=3D L'\n') -+ wc2 =3D L' '; -+ else -+ t2 +=3D mblen2; -+ -+ break; -+ -+ case IGNORE_TAB_EXPANSION: -+ if ((wc1 =3D=3D L' ' && wc2 =3D=3D L'\t') -+ || (wc1 =3D=3D L'\t' && wc2 =3D=3D L' ')) -+ { -+ size_t column2 =3D column; -+ -+ while (1) -+ { -+ if (convfail1) -+ { -+ ++t1; -+ break; -+ } -+ else if (wc1 =3D=3D L' ') -+ column++; -+ else if (wc1 =3D=3D L'\t') -+ column +=3D TAB_WIDTH - column % TAB_WIDTH; -+ else -+ { -+ t1 +=3D mblen1; -+ break; -+ } -+ -+ t1 +=3D mblen1; -+ c1 =3D *t1; -+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1); -+ } -+ -+ while (1) -+ { -+ if (convfail2) -+ { -+ ++t2; -+ break; -+ } -+ else if (wc2 =3D=3D L' ') -+ column2++; -+ else if (wc2 =3D=3D L'\t') -+ column2 +=3D TAB_WIDTH - column2 % TAB_WIDTH; -+ else -+ { -+ t2 +=3D mblen2; -+ break; -+ } -+ -+ t2 +=3D mblen2; -+ c2 =3D *t2; -+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2); -+ } -+ -+ if (column !=3D column2) -+ return 1; -+ } -+ else -+ { -+ t1 +=3D mblen1; -+ t2 +=3D mblen2; -+ } -+ break; -+ -+ case IGNORE_NO_WHITE_SPACE: -+ t1 +=3D mblen1; -+ t2 +=3D mblen2; -+ break; -+ } -+ -+ /* Lowercase all letters if -i is specified. */ -+ if (ignore_case) -+ { -+ if (!convfail1) -+ wc1 =3D towlower (wc1); -+ if (!convfail2) -+ wc2 =3D towlower (wc2); -+ } -+ -+ if (convfail1 ^ convfail2) -+ break; -+ else if (convfail1 && convfail2 && c1 !=3D c2) -+ break; -+ else if (!convfail1 && !convfail2 && wc1 !=3D wc2) -+ break; -+ } -+ else -+ { -+ t1_bak =3D t1; t2_bak =3D t2; -+ wc1_bak =3D wc1; wc2_bak =3D wc2; -+ state1_bak =3D state1; state2_bak =3D state2; -+ convfail1_bak =3D convfail1; convfail2_bak =3D convfail2; -+ -+ t1 +=3D mblen1; t2 +=3D mblen2; -+ } -+ =20 -+ if (!convfail1 && wc1 =3D=3D L'\n') -+ return 0; -+ -+ column +=3D convfail1 ? 1 : -+ (wc1 =3D=3D L'\t') ? TAB_WIDTH - column % TAB_WIDTH : wcwidth (wc1); -+ } -+ -+ return 1; -+} -+#endif - =0C - /* Find the consecutive changes at the start of the script START. - Return the last link before the first gap. */ --=20 1.9.1 --===============3559663381574588428==--