filename: SEDMFIX1.TXT purpose: fixes a bug in the 'd' command of sedmod version 1.0 summary: Sedmod v1.0 has a bug in the 'd' command when the -i (ignore case) switch is also used. The normal sed command sedmod -i "/pattern/d" input.fil does not always locate (with a case-insensitive match) and delete each line that matches the pattern. The following fix to the sedmod source code is submitted by Ken Pizzini and was posted on the seders mailing list on Tue, 22 Sep 1998 20:19:13 -0600. Ken's message follows: ----------------------------------------------------------------- Sedmod is noting that it should do case-normalization during its compile phase, but the block of code which does this does not get executed for all possible commands, 'd' being one of those that gets missed. The patch below corrects the bugs that Eric noted (I haven't tested enough to be certain that this does not introduce any new bugs). --Ken Pizzini --- sedcomp.c-orig Tue Sep 22 19:44:27 1998 +++ sedcomp.c Tue Sep 22 20:08:48 1998 @@ -258,6 +258,8 @@ else if ((fp = address(cmdp->addr1 = fp)) == BAD) ABORT(AGMSG); + cmdp->flags.igcase = iflag; + if (fp == cmdp->addr1) /* if empty RE was found */ { if (lastre) /* if there was previous RE */ @@ -327,8 +329,6 @@ sedcmd *sp1, *sp2; /* temps for label searches */ label *lpt, *search(); /* ditto, and the searcher */ char redelim; /* current RE delimiter */ - - cmdp->flags.igcase = iflag; switch(cchar) { ----------------------------------------------------------------- The foregoing changes were made with the Unix 'diff' utility using the -u switch (for "unified output format"). To correct the source code, use the Unix 'patch' utility -- the one written by Perl author Larry Wall -- to modify the source file. You should be able to do this: patch -d \path\to\sedmod\source sedcomp.c \path\to\sedmfix1.txt to update the file SEDCOMP.C, with a backup copy retained under the filename SEDCOMP.ORG. If your version of patch is not 2.0.2.0 or later, it will not recognize the unified output format, and the SEDCOMP.C file will not be altered. Patch v2.0.2.0 version 12 is available for DOS at this location: ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish/patch212.zip If you do not have the 'patch' program and do not wish to install it, you can also make this patch by simply moving lines 330 and 331 to just below line 260, and optionally correcting the indentation of the moved line. Remarks written by Eric Pement on 09/29/1998 03:13pm