version 1.21, 2000/07/06 06:24:21 |
version 1.22, 2001/01/16 05:36:08 |
|
|
|
|
char *prompt = "& "; |
char *prompt = "& "; |
|
|
|
const struct cmd *com; /* command we are running */ |
|
|
/* |
/* |
* Set up editing on the given file name. |
* Set up editing on the given file name. |
* If the first character of name is %, we are considered to be |
* If the first character of name is %, we are considered to be |
|
|
{ |
{ |
char word[LINESIZE]; |
char word[LINESIZE]; |
char *arglist[MAXARGC]; |
char *arglist[MAXARGC]; |
const struct cmd *com = NULL; |
|
char *cp, *cp2; |
char *cp, *cp2; |
int c, muvec[2]; |
int c, muvec[2]; |
int e = 1; |
int e = 1; |
|
|
|
com = NULL; |
|
|
/* |
/* |
* Strip the white space away from the beginning |
* Strip the white space away from the beginning |
* of the command, then scan out a word, which |
* of the command, then scan out a word, which |
|
|
goto out; |
goto out; |
} |
} |
switch (com->c_argtype & ~(F|P|I|M|T|W|R)) { |
switch (com->c_argtype & ~(F|P|I|M|T|W|R)) { |
|
case MSGLIST|STRLIST: |
|
/* |
|
* A message list defaulting to nearest forward |
|
* legal message. |
|
*/ |
|
if (msgvec == 0) { |
|
puts("Illegal use of \"message list\""); |
|
break; |
|
} |
|
/* |
|
* remove leading blanks. |
|
*/ |
|
while (isspace(*cp)) |
|
cp++; |
|
|
|
if (isdigit(*cp) || *cp == ':') { |
|
if ((c = getmsglist(cp, msgvec, com->c_msgflag)) < 0) |
|
break; |
|
/* position to next space - past the message list */ |
|
while (!isspace(*cp)) |
|
cp++; |
|
/* position to next non-space */ |
|
while (isspace(*cp)) |
|
cp++; |
|
} else { |
|
c = 0; /* no message list */ |
|
} |
|
|
|
if (c == 0) { |
|
*msgvec = first(com->c_msgflag, |
|
com->c_msgmask); |
|
msgvec[1] = NULL; |
|
} |
|
if (*msgvec == NULL) { |
|
puts("No applicable messages"); |
|
break; |
|
} |
|
/* |
|
* Just the straight string, with |
|
* leading blanks removed. |
|
*/ |
|
while (isspace(*cp)) |
|
cp++; |
|
|
|
e = (*com->c_func2)(msgvec, cp); |
|
break; |
|
|
case MSGLIST: |
case MSGLIST: |
/* |
/* |
* A message list defaulting to nearest forward |
* A message list defaulting to nearest forward |
|
|
int vec[2], mdot; |
int vec[2], mdot; |
|
|
mdot = newfileinfo(0); |
mdot = newfileinfo(0); |
clearnew(); |
|
vec[0] = mdot; |
vec[0] = mdot; |
vec[1] = 0; |
vec[1] = 0; |
dot = &message[mdot - 1]; |
dot = &message[mdot - 1]; |