wswietse@eutrc3.UUCP (Wietse Venema) (04/15/88)
The following patches to the sed program (posted sept 1987?) solve the problems I stumbled upon. The program now seems to work fine on the Sun 3/160 and an AT running System-V. For real UNIX compatibility you should remove the support for the + operator in regular expressions... *** sedcomp.c.orig Fri Apr 15 11:27:22 1988 --- sedcomp.c Fri Apr 15 13:11:43 1988 *************** *** 538,545 **** c = '\n'; else if (c == 't') /* match a tab */ c = '\t'; ! else ! goto defchar; /* else match \c */ case '\0': /* ignore nuls */ continue; --- 538,544 ---- c = '\n'; else if (c == 't') /* match a tab */ c = '\t'; ! goto defchar; /* else match \c */ case '\0': /* ignore nuls */ continue; *************** *** 786,792 **** register char *ep; /* where to compile to */ char delim; /* end delimiter to look for */ { ! register char c, *tp, *sp; /* scan the 'from' section for invalid chars */ for(sp = tp = cp; *tp != delim; tp++) --- 785,792 ---- register char *ep; /* where to compile to */ char delim; /* end delimiter to look for */ { ! register char *tp, *sp; ! register int c; /* scan the 'from' section for invalid chars */ for(sp = tp = cp; *tp != delim; tp++) *** sedexec.c.orig Fri Apr 15 11:27:25 1988 --- sedexec.c Fri Apr 15 14:54:31 1988 *************** *** 43,49 **** /***** end of imported stuff *****/ #define MAXHOLD MAXBUF /* size of the hold space */ ! #define GENSIZ 71 /* maximum genbuf size */ #define TRUE 1 #define FALSE 0 --- 43,49 ---- /***** end of imported stuff *****/ #define MAXHOLD MAXBUF /* size of the hold space */ ! #define GENSIZ BUFSIZ /* maximum genbuf size */ #define TRUE 1 #define FALSE 0 *************** *** 225,230 **** --- 225,231 ---- ipc++; return(FALSE); } + return(!ipc->flags.allbut); } static int match(expbuf, gf) /* uses genbuf */ -- uucp: mcvax!eutrc3!wswietse | Eindhoven University of Technology bitnet: wswietse@heithe5 | Dept. of Mathematics and Computer Science surf: tuerc5::wswietse | Eindhoven, The Netherlands.