bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about gawk unofficial patch


From: 木村浩一
Subject: Question about gawk unofficial patch
Date: Wed, 09 Feb 2005 10:05:56 +0900

Hello, My name is Kimura Koichi. Gawk user in Japan.

I have tesed unofficial patch 
(http://lists.nongnu.org/archive/html/bug-gnu-utils/2005-01/msg00043.html)
at Windows 2000 and Visual C++
(add my private patch for multibyte aware) and have some question.

In patch,

@@ -279,6 +287,15 @@
                emalloc(r->stptr, char *, r->stlen + 2, "dupnode");
                memcpy(r->stptr, n->stptr, r->stlen);
                r->stptr[r->stlen] = '\0';
+#if defined MBS_SUPPORT
+               if ((n->flags & WSTRCUR) != 0) {
+                       r->wstlen = n->wstlen;
+                       emalloc(r->wstptr, wchar_t *, sizeof(wchar_t) * 
(r->wstlen + 2), "dupnode");
+                       memcpy(r->wstptr, n->wstptr, r->wstlen);
+                       r->wstptr[r->wstlen] = L'\0';
+                       r->flags |= WSTRCUR;
+               }
+#endif /* defined MBS_SUPPORT */

malloced memory sizeof(wchar_t) * (r->wstlen + 2) bytes,
but just only copied r->wstlen bytes. I guess this is not enough.

And in node.c,

        getnode(r);
        *r = *n;
        r->flags &= ~(PERM|TEMP|FIELD);
        r->flags |= MALLOC;
        r->wstptr = NULL; //###

If ### line is nothing, some script cause corrupted print out.
(If you could use Japanese environment, I can show you data for
reproduce)

Sorry for my poor english.
Sincerely yours,

-- 
Kimura Koichi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]