Mario Fetka wrote:
i also had this problem.
after applying the fedora gawk patches the problem has gone
http://cvs.fedora.redhat.com/viewcvs/devel/gawk/

Thanks for the pointer. The dfa_cache patch solved the issue for me. Bernard, could you apply the following to gawk-3.1.4 and report your results please?

Cheers,

Matt.
--- gawk-3.1.4/dfa.c.dfacache	2004-11-09 14:42:53.594099744 +0100
+++ gawk-3.1.4/dfa.c	2004-11-09 14:45:38.661005760 +0100
@@ -2871,6 +2871,14 @@
   if (MB_CUR_MAX > 1)
     {
       int remain_bytes, i;
+#if 0
+      /*
+       * This caching can get things wrong:
+
+      printf "ab\n\tb\n" | LC_ALL=de_DE.UTF-8 ./gawk '/^[ \t]/ { print }'
+
+       * should print \tb but doesn't
+       */
       buf_begin -= buf_offset;
       if (buf_begin <= (unsigned char const *)begin && (unsigned char const *) end <= buf_end) {
 	buf_offset = (unsigned char const *)begin - buf_begin;
@@ -2878,6 +2886,7 @@
 	buf_end = end;
 	goto go_fast;
       }
+#endif
 
       buf_offset = 0;
       buf_begin = begin;
@@ -2916,7 +2925,9 @@
       mblen_buf[i] = 0;
       inputwcs[i] = 0; /* sentinel */
     }
+#if 0
 go_fast:
+#endif
 #endif /* MBS_SUPPORT */
 
   for (;;)
@@ -2930,7 +2941,7 @@
             s1 = s;
 	    if (d->states[s].mbps.nelem != 0)
 	      {
-		/* Can match with a multibyte character( and multi character
+		/* Can match with a multibyte character (and multi character
 		   collating element).  */
 		unsigned char const *nextp;
 
@@ -3668,9 +3679,9 @@
  done:
   if (strlen(result))
     {
-      dm = (struct dfamust *) malloc(sizeof (struct dfamust));
+      MALLOC(dm, struct dfamust, 1);
       dm->exact = exact;
-      dm->must = malloc(strlen(result) + 1);
+      MALLOC(dm->must, char, strlen(result) + 1);
       strcpy(dm->must, result);
       dm->next = dfa->musts;
       dfa->musts = dm;
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to