Hi,
In csh with filec enabled the prompt is displayed prior enabling
noncanonical mode on the tty. ksh on the other hand ensures the desired
mode is entered prior doing any I/O on the tty. This diff displays the
prompt after noncanonical mode has been enabled which also makes the
regress tests more reliable.

Joint work with bluhm@

Comments? OK?

Index: csh.c
===================================================================
RCS file: /cvs/src/bin/csh/csh.c,v
retrieving revision 1.39
diff -u -p -r1.39 csh.c
--- csh.c       19 Mar 2016 15:42:38 -0000      1.39
+++ csh.c       25 Jul 2017 20:44:40 -0000
@@ -1008,7 +1008,7 @@ process(bool catch)
             * read fresh stuff. Otherwise, we are rereading input and don't
             * need or want to prompt.
             */
-           if (aret == F_SEEK && fseekp == feobp)
+           if (!filec && aret == F_SEEK && fseekp == feobp)
                printprompt();
            (void) fflush(cshout);
        }
Index: file.c
===================================================================
RCS file: /cvs/src/bin/csh/file.c,v
retrieving revision 1.31
diff -u -p -r1.31 file.c
--- file.c      18 Jul 2017 17:24:42 -0000      1.31
+++ file.c      25 Jul 2017 20:44:40 -0000
@@ -779,6 +779,8 @@ tenex(Char *inputline, int inputline_siz
        cl.size = sizeof(buf);
        if (tio->c_lflag & ALTWERASE)
                cl.flags |= CL_ALTWERASE;
+       cl.flags |= CL_PROMPT;
+       cl_flush(&cl);  /* print prompt */
 
        for (;;) {
                if ((c = cl_getc(&cl)) == 0)
Index: func.c
===================================================================
RCS file: /cvs/src/bin/csh/func.c,v
retrieving revision 1.33
diff -u -p -r1.33 func.c
--- func.c      14 Aug 2016 19:46:31 -0000      1.33
+++ func.c      25 Jul 2017 20:44:40 -0000
@@ -589,7 +589,7 @@ search(int type, int level, Char *goal)
        bseek(&a);
     }
     do {
-       if (intty && fseekp == feobp && aret == F_SEEK)
+       if (intty && !filec && fseekp == feobp && aret == F_SEEK)
            (void) fprintf(cshout, "? "), (void) fflush(cshout);
        aword[0] = 0;
        (void) getword(aword);

Reply via email to