30 for ( ; wl; wl = wl->wl_next) {
33 if (
eq(wl->wl_word,
"-n"))
36 if (
eq(wl->wl_word,
"-r"))
58 if (!(editor =
getenv(
"EDITOR"))) {
62 editor =
"/usr/ucb/vi";
65 (void) sprintf(buf,
"%s %s", editor, filename);
80 FILE *fp,*errfp,*outfp,*errtmp,*outtmp;
81 char *errmsg =
"Error: no symbolic representation found.\n";
82 char *filename,*errfile,*outfile;
91 if (
eq(
wl->wl_word,
"-n")) {
95 if (
eq(
wl->wl_word,
"-r")) {
99 filename =
wl->wl_word;
107 errfp = fopen(errfile,
"w+");
108 outfp = fopen(outfile,
"w");
109 if (errfp ==
NULL || outfp ==
NULL) {
110 fprintf(
cp_err,
"Error: redirection failed.\n");
117 (void)
sced(filename);
144 struct line *deck, *dd;
146 FILE *lastin, *lastout, *lasterr;
154 fprintf(
cp_err,
"Warning: no cards in deck...\n");
174 (commands && (*dd->
li_line ==
'#' ||
186 "Warning: redundant .control card\n");
198 "Warning: misplaced .endc card\n");
231 char *tempfile =
NULL, *fname;
238 for (; wl; wl = wn) {
240 if (*wl->wl_word !=
'-')
242 if (!strchr(wl->wl_word,
'n') &&
243 !strchr(wl->wl_word,
'c') &&
244 !strchr(wl->wl_word,
'r'))
259 if (wl && wl->wl_next) {
271 while ((i = fread(buf, 1,
BSIZE_SP, tp)) > 0)
272 (void) fwrite(buf, 1, i, fp);
276 (void) fseek(fp, (
long) 0, 0);
static char buf[MAXPROMPT]
bool cp_getvar(char *n, int t, char *r)
void inp_nutsource(FILE *fp, bool comfile, char *filename)
void nutcom_source(wordlist *wl)
struct wordlist * wl_prev
bool inp_edit(char *filename)
static struct ccom * commands
void nutcom_edit(wordlist *wl)
struct wordlist * wl_next
void ShowPrompt(char *str)