Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 78227 | Differences between
and this patch

Collapse All | Expand All

(-)gawk-3.1.4/dfa.c.dfacache (-3 / +14 lines)
Lines 2871-2876 Link Here
2871
  if (MB_CUR_MAX > 1)
2871
  if (MB_CUR_MAX > 1)
2872
    {
2872
    {
2873
      int remain_bytes, i;
2873
      int remain_bytes, i;
2874
#if 0
2875
      /*
2876
       * This caching can get things wrong:
2877
2878
      printf "ab\n\tb\n" | LC_ALL=de_DE.UTF-8 ./gawk '/^[ \t]/ { print }'
2879
2880
       * should print \tb but doesn't
2881
       */
2874
      buf_begin -= buf_offset;
2882
      buf_begin -= buf_offset;
2875
      if (buf_begin <= (unsigned char const *)begin && (unsigned char const *) end <= buf_end) {
2883
      if (buf_begin <= (unsigned char const *)begin && (unsigned char const *) end <= buf_end) {
2876
	buf_offset = (unsigned char const *)begin - buf_begin;
2884
	buf_offset = (unsigned char const *)begin - buf_begin;
Lines 2878-2883 Link Here
2878
	buf_end = end;
2886
	buf_end = end;
2879
	goto go_fast;
2887
	goto go_fast;
2880
      }
2888
      }
2889
#endif
2881
2890
2882
      buf_offset = 0;
2891
      buf_offset = 0;
2883
      buf_begin = begin;
2892
      buf_begin = begin;
Lines 2916-2922 Link Here
2916
      mblen_buf[i] = 0;
2925
      mblen_buf[i] = 0;
2917
      inputwcs[i] = 0; /* sentinel */
2926
      inputwcs[i] = 0; /* sentinel */
2918
    }
2927
    }
2928
#if 0
2919
go_fast:
2929
go_fast:
2930
#endif
2920
#endif /* MBS_SUPPORT */
2931
#endif /* MBS_SUPPORT */
2921
2932
2922
  for (;;)
2933
  for (;;)
Lines 2930-2936 Link Here
2930
            s1 = s;
2941
            s1 = s;
2931
	    if (d->states[s].mbps.nelem != 0)
2942
	    if (d->states[s].mbps.nelem != 0)
2932
	      {
2943
	      {
2933
		/* Can match with a multibyte character( and multi character
2944
		/* Can match with a multibyte character (and multi character
2934
		   collating element).  */
2945
		   collating element).  */
2935
		unsigned char const *nextp;
2946
		unsigned char const *nextp;
2936
2947
Lines 3668-3676 Link Here
3668
 done:
3679
 done:
3669
  if (strlen(result))
3680
  if (strlen(result))
3670
    {
3681
    {
3671
      dm = (struct dfamust *) malloc(sizeof (struct dfamust));
3682
      MALLOC(dm, struct dfamust, 1);
3672
      dm->exact = exact;
3683
      dm->exact = exact;
3673
      dm->must = malloc(strlen(result) + 1);
3684
      MALLOC(dm->must, char, strlen(result) + 1);
3674
      strcpy(dm->must, result);
3685
      strcpy(dm->must, result);
3675
      dm->next = dfa->musts;
3686
      dm->next = dfa->musts;
3676
      dfa->musts = dm;
3687
      dfa->musts = dm;

Return to bug 78227