From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay2.UU.NET ([192.48.96.7]) by hawkwind.utcs.toronto.edu with SMTP id <2223>; Thu, 13 May 1993 14:14:41 -0400 Received: from spool.uu.net (via LOCALHOST.UU.NET) by relay2.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA25941; Thu, 13 May 93 14:13:18 -0400 Received: from srg.UUCP by spool.uu.net with UUCP/RMAIL (queueing-rmail) id 141147.23295; Thu, 13 May 1993 14:11:47 EDT Received: from ceres.srg.af.mil by srg.srg.af.mil id aa24773; Thu, 13 May 93 13:59:13 EDT From: culliton@srg.af.mil (Tom Culliton x2278) X-Mailer: SCO System V Mail (version 3.2) To: rc@hawkwind.utcs.toronto.edu Subject: A patch for prompting (was Re: trip took a wrong turn: dot -i) Date: Thu, 13 May 1993 13:59:40 -0400 Message-Id: <9305131359.aa20263@ceres.srg.af.mil> Here is my patch for the problem in input.c and lex.c. Note that I moved the function print_prompt2 from lex.c to input.c to keep the variable istack static to input.c. This patch is against version 1.4 "as released" and includes the one line patch I sent shortly after the release. With the patch applied the corrected (~! fixed to !~) trip.rc completes successfully. Tom ----------8<--------------------CUT HERE--------------------8<---------- *** lex.c.old Mon May 25 14:11:51 1992 --- lex.c Thu May 13 11:44:24 1993 *************** *** 339,354 **** realbuf = ealloc(bufsize); } - extern void print_prompt2() { - lineno++; - #ifdef READLINE - prompt = prompt2; - #else - if (interactive) - fprint(2, "%s", prompt2); - #endif - } - /* Scan in a pair of integers for redirections like >[2=1]. CLOSED represents a closed file descriptor (i.e., >[2=]) and UNSET represents an undesignated file descriptor (e.g., --- 339,344 ---- *** input.c.old Mon May 25 15:31:28 1992 --- input.c Thu May 13 12:08:17 1993 *************** *** 117,123 **** while (1) { #ifdef READLINE if (interactive && istack->fd == 0) { ! rlinebuf = readline(prompt); if (rlinebuf == NULL) { chars_in = 0; } else { --- 117,123 ---- while (1) { #ifdef READLINE if (interactive && istack->fd == 0) { ! rlinebuf = rc_readline(prompt); if (rlinebuf == NULL) { chars_in = 0; } else { *************** *** 275,284 **** } if ((s = varlookup("prompt")) != NULL) { #ifdef READLINE ! prompt = s->w; ! #else ! fprint(2, "%s", s->w); #endif prompt2 = (s->n == NULL ? "" : s->n->w); } } --- 275,285 ---- } if ((s = varlookup("prompt")) != NULL) { #ifdef READLINE ! if (istack->fd == 0) ! prompt = s->w; ! else #endif + fprint(2, "%s", s->w); prompt2 = (s->n == NULL ? "" : s->n->w); } } *************** *** 298,303 **** --- 299,317 ---- unexcept(); /* eError */ return parsetree; } + + extern void print_prompt2() { + lineno++; + if (interactive) + { + #ifdef READLINE + if (istack->fd == 0) + prompt = prompt2; + else + #endif + fprint(2, "%s", prompt2); + } + } /* parse a function imported from the environment */