Only a single slash (/) is now necessary to repeat a search as per Theo's

request.  So the command:
/pattern/;/
finds the second line containing "pattern" after the current line.
Caveat: The commands `st' and `sr'  are now both legal and have very
different meanings.  This is because ed(1) extends POSIX to include the
old Berkeley syntax s[rgp]*.
(So should two slashes still be required in the case of the substitute
command, as SunOS ed does?)
This commit is contained in:
Andrew Moore 1993-08-27 22:14:24 +00:00
parent 6bef4df57c
commit 0bca9fd9dc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339

View file

@ -64,13 +64,10 @@ optpat()
char delim;
int n;
if ((delim = *ibufp) == '\n') {
if (!exp) sprintf(errmsg, "no previous pattern");
return exp;
} else if (delim == ' ' || *++ibufp == '\n') {
if ((delim = *ibufp) == ' ') {
sprintf(errmsg, "invalid pattern delimiter");
return NULL;
} else if (*ibufp == delim) {
} else if (delim == '\n' || *++ibufp == '\n' || *ibufp == delim) {
if (!exp) sprintf(errmsg, "no previous pattern");
return exp;
} else if ((exps = getlhs(delim)) == NULL)