--- /dev/null 2010-02-24 16:09:00.000000000 +1100 +++ patches/patch-bc 2010-02-24 16:06:47.000000000 +1100 @@ -0,0 +1,94 @@ +$NetBSD: patch-bc,v Exp $ + +--- Src/exec.c.orig 2007-12-11 20:35:25.000000000 +1100 ++++ Src/exec.c 2010-02-24 16:05:40.000000000 +1100 +@@ -1734,17 +1734,17 @@ + int l = strlen(str) + 1, nl = (l + 31) & ~31; + + if (nl > underscorelen || (underscorelen - nl) > 64) { +- zfree(underscore, underscorelen); +- underscore = (char *) zalloc(underscorelen = nl); ++ zfree(zunderscore, underscorelen); ++ zunderscore = (char *) zalloc(underscorelen = nl); + } +- strcpy(underscore, str); ++ strcpy(zunderscore, str); + underscoreused = l; + } else { + if (underscorelen > 128) { +- zfree(underscore, underscorelen); +- underscore = (char *) zalloc(underscorelen = 32); ++ zfree(zunderscore, underscorelen); ++ zunderscore = (char *) zalloc(underscorelen = 32); + } +- *underscore = '\0'; ++ *zunderscore = '\0'; + underscoreused = 1; + } + } +@@ -3767,7 +3767,7 @@ + int cont; + VARARR(char, ou, underscoreused); + +- memcpy(ou, underscore, underscoreused); ++ memcpy(ou, zunderscore, underscoreused); + + while (wrap) { + wrap->module->wrapper++; +@@ -3995,7 +3995,7 @@ + es->trapreturn = trapreturn; + es->noerrs = noerrs; + es->subsh_close = subsh_close; +- es->underscore = ztrdup(underscore); ++ es->underscore = ztrdup(zunderscore); + es->next = exstack; + exstack = es; + noerrs = cmdoutpid = 0; + +--- Src/init.c.orig 2007-11-26 20:38:49.000000000 +1100 ++++ Src/init.c 2010-02-24 16:04:52.000000000 +1100 +@@ -42,7 +42,7 @@ + /* buffer for $_ and its length */ + + /**/ +-char *underscore; ++char *zunderscore; + + /**/ + int underscorelen, underscoreused; +@@ -773,9 +773,9 @@ + ifs = ztrdup(DEFAULT_IFS); + wordchars = ztrdup(DEFAULT_WORDCHARS); + postedit = ztrdup(""); +- underscore = (char *) zalloc(underscorelen = 32); ++ zunderscore = (char *) zalloc(underscorelen = 32); + underscoreused = 1; +- *underscore = '\0'; ++ *zunderscore = '\0'; + + zoptarg = ztrdup(""); + zoptind = 1; + +--- Src/params.c.orig 2007-11-29 21:15:18.000000000 +1100 ++++ Src/params.c 2010-02-24 16:04:52.000000000 +1100 +@@ -3347,7 +3347,7 @@ + char * + underscoregetfn(UNUSED(Param pm)) + { +- char *u = dupstring(underscore); ++ char *u = dupstring(zunderscore); + + untokenize(u); + return u; + +--- Src/utils.c.orig 2007-12-11 20:35:25.000000000 +1100 ++++ Src/utils.c 2010-02-24 16:04:52.000000000 +1100 +@@ -807,7 +807,7 @@ + } else { + VARARR(char, usav, underscoreused); + +- memcpy(usav, underscore, underscoreused); ++ memcpy(usav, zunderscore, underscoreused); + + setunderscore(*s); +