The second argument of "void set_prompt(int, Source *)" is unused ever
since the special treatment of ! and !! in the PS1 expansion was removed
from set_prompt() as part of the implementation of the character count
toggles \[ and \] way back in 2004.

Index: c_sh.c
===================================================================
RCS file: /var/cvs/src/bin/ksh/c_sh.c,v
retrieving revision 1.60
diff -u -p -r1.60 c_sh.c
--- c_sh.c      22 Jul 2017 09:37:21 -0000      1.60
+++ c_sh.c      6 Dec 2017 23:59:45 -0000
@@ -361,7 +361,7 @@ c_read(char **wp)
                                                /* set prompt in case this is
                                                 * called from .profile or $ENV
                                                 */
-                                               set_prompt(PS2, NULL);
+                                               set_prompt(PS2);
                                                pprompt(prompt, 0);
                                        }
                                } else if (c != EOF)
Index: lex.c
===================================================================
RCS file: /var/cvs/src/bin/ksh/lex.c,v
retrieving revision 1.71
diff -u -p -r1.71 lex.c
--- lex.c       4 Jul 2017 11:46:15 -0000       1.71
+++ lex.c       6 Dec 2017 23:59:59 -0000
@@ -1165,7 +1165,7 @@ getsc_line(Source *s)
 #endif /* HISTORY */
        }
        if (interactive)
-               set_prompt(PS2, NULL);
+               set_prompt(PS2);
 }
 
 static char *
@@ -1180,7 +1180,7 @@ special_prompt_expand(char *str)
 }
 
 void
-set_prompt(int to, Source *s)
+set_prompt(int to)
 {
        char *ps1;
        Area *saved_atemp;
Index: lex.h
===================================================================
RCS file: /var/cvs/src/bin/ksh/lex.h,v
retrieving revision 1.16
diff -u -p -r1.16 lex.h
--- lex.h       10 Oct 2015 07:35:16 -0000      1.16
+++ lex.h       7 Dec 2017 00:00:11 -0000
@@ -118,5 +118,5 @@ int yylex(int);
 void   yyerror(const char *, ...)
            __attribute__((__noreturn__, __format__ (printf, 1, 2)));
 Source * pushs(int, Area *);
-void   set_prompt(int, Source *);
+void   set_prompt(int);
 void   pprompt(const char *, int);
Index: main.c
===================================================================
RCS file: /var/cvs/src/bin/ksh/main.c,v
retrieving revision 1.83
diff -u -p -r1.83 main.c
--- main.c      11 Aug 2017 23:10:55 -0000      1.83
+++ main.c      7 Dec 2017 00:00:04 -0000
@@ -609,7 +609,7 @@ shell(Source *volatile s, volatile int t
                        got_sigwinch = 1;
                        j_notify();
                        mcheck();
-                       set_prompt(PS1, s);
+                       set_prompt(PS1);
                }
 
                t = compile(s);

Reply via email to