#! /bin/sh /usr/share/dpatch/dpatch-run ## 23_null_in_multibyte.dpatch by ## ## Original patch by Paul Eggert ## See http://lists.gnu.org/archive/html/bug-gnu-utils/2005-11/msg00115.html ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Length returns inconsistent results with embedded NUL characters @DPATCH@ --- node.c-bak 2005-07-26 11:07:43.000000000 -0700 +++ gawk-3.1.5/node.c 2005-11-30 13:33:44.000000000 -0800 @@ -749,9 +749,10 @@ str2wstr(NODE *n, size_t **ptr) switch (count) { case (size_t) -2: case (size_t) -1: - case 0: goto done; + case 0: + count = 1; default: *wsp++ = wc; src_count -= count;