version 1.5, 1997/03/14 04:32:13 |
version 1.6, 1997/04/23 20:33:02 |
|
|
struct cmd *c; |
struct cmd *c; |
|
|
if (argc < 2 && !another(&argc, &argv, "macro name")) { |
if (argc < 2 && !another(&argc, &argv, "macro name")) { |
printf("usage: %s macro_name\n", argv[0]); |
fprintf(ttyout, "usage: %s macro_name\n", argv[0]); |
code = -1; |
code = -1; |
return; |
return; |
} |
} |
|
|
} |
} |
} |
} |
if (i == macnum) { |
if (i == macnum) { |
printf("'%s' macro not found.\n", argv[1]); |
fprintf(ttyout, "'%s' macro not found.\n", argv[1]); |
code = -1; |
code = -1; |
return; |
return; |
} |
} |
|
|
makeargv(); |
makeargv(); |
c = getcmd(margv[0]); |
c = getcmd(margv[0]); |
if (c == (struct cmd *)-1) { |
if (c == (struct cmd *)-1) { |
puts("?Ambiguous command."); |
fputs("?Ambiguous command.\n", ttyout); |
code = -1; |
code = -1; |
} |
} |
else if (c == 0) { |
else if (c == 0) { |
puts("?Invalid command."); |
fputs("?Invalid command.\n", ttyout); |
code = -1; |
code = -1; |
} |
} |
else if (c->c_conn && !connected) { |
else if (c->c_conn && !connected) { |
puts("Not connected."); |
fputs("Not connected.\n", ttyout); |
code = -1; |
code = -1; |
} |
} |
else { |
else { |
if (verbose) |
if (verbose) { |
puts(line); |
fputs(line, ttyout); |
|
fputs("\n", ttyout); |
|
} |
(*c->c_handler)(margc, margv); |
(*c->c_handler)(margc, margv); |
if (bell && c->c_bell) { |
if (bell && c->c_bell) { |
(void)putchar('\007'); |
(void)putc('\007', ttyout); |
} |
} |
(void)strcpy(line, line2); |
(void)strcpy(line, line2); |
makeargv(); |
makeargv(); |