Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site panda.UUCP Path: utzoo!decvax!bellcore!ulysses!allegra!mit-eddie!genrad!panda!sources-request From: sources-request@panda.UUCP Newsgroups: mod.sources Subject: 2nd bug fix for regexp(3), in regsub() Message-ID: <1524@panda.UUCP> Date: Sat, 15-Mar-86 09:36:46 EST Article-I.D.: panda.1524 Posted: Sat Mar 15 09:36:46 1986 Date-Received: Sun, 16-Mar-86 06:00:03 EST Sender: jpn@panda.UUCP Lines: 21 Approved: jpn@panda.UUCP Mod.sources: Volume 4, Issue 33 Submitted by: genrad!decvax!utzoo!henry I cringe with embarrassment! Another bug in regexp! In regsub.c, the following line (line 72 in the original distribution): if (*(dst-1) == '\0') { /* strncpy hit NUL. */ should read if (len != 0 && *(dst-1) == '\0') { /* strncpy hit NUL. */ This shows up as an occasional spurious complaint from regsub about "damaged match string"... *if* the program invoking it, and the compiler compiling it, happen to interact just right. It didn't show in any of my tests because mine don't. My thanks to H}vard Eidnes for finding this. Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry