From: culliton@srg.af.mil (Tom Culliton x2278)
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 [thread overview]
Message-ID: <9305131359.aa20263@ceres.srg.af.mil> (raw)
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 */
reply other threads:[~1993-05-13 18:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9305131359.aa20263@ceres.srg.af.mil \
--to=culliton@srg.af.mil \
--cc=rc@hawkwind.utcs.toronto.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).