Blame SOURCES/expect-5.45.4-covscan-fixes.patch

6b7353
diff -up expect5.45.4/exp_chan.c.orig expect5.45.4/exp_chan.c
6b7353
--- expect5.45.4/exp_chan.c.orig	2018-02-02 20:15:52.000000000 +0100
6b7353
+++ expect5.45.4/exp_chan.c	2018-10-10 09:29:44.702617967 +0200
6b7353
@@ -51,6 +51,8 @@ static void		ExpWatchProc _ANSI_ARGS_((C
6b7353
 		            int mask));
6b7353
 static int		ExpGetHandleProc _ANSI_ARGS_((ClientData instanceData,
6b7353
 		            int direction, ClientData *handlePtr));
6b7353
+void			exp_background_channelhandler _ANSI_ARGS_((ClientData,
6b7353
+		            int));
6b7353
 
6b7353
 /*
6b7353
  * This structure describes the channel type structure for Expect-based IO:
6b7353
diff -up expect5.45.4/exp_clib.c.orig expect5.45.4/exp_clib.c
6b7353
--- expect5.45.4/exp_clib.c.orig	2018-10-10 09:29:44.695617962 +0200
6b7353
+++ expect5.45.4/exp_clib.c	2018-10-10 09:29:44.723617980 +0200
6b7353
@@ -37,6 +37,14 @@ would appreciate credit if this program
6b7353
 # endif
6b7353
 #endif
6b7353
 
6b7353
+#ifdef HAVE_UNISTD_H
6b7353
+# include <unistd.h>
6b7353
+#endif
6b7353
+
6b7353
+//#ifdef HAVE_SYS_WAIT_H
6b7353
+# include <sys/wait.h>
6b7353
+//#endif
6b7353
+
6b7353
 #ifdef HAVE_SYS_FCNTL_H
6b7353
 #  include <sys/fcntl.h>
6b7353
 #else
6b7353
@@ -2196,6 +2204,7 @@ int exp_getptyslave();
6b7353
 #define sysreturn(x)	return(errno = x, -1)
6b7353
 
6b7353
 void exp_init_pty();
6b7353
+void exp_init_tty();
6b7353
 
6b7353
 /*
6b7353
    The following functions are linked from the Tcl library.  They
6b7353
@@ -2715,6 +2724,7 @@ exp_spawnl TCL_VARARGS_DEF(char *,arg1)
6b7353
 		argv[i] = va_arg(args,char *);
6b7353
 		if (!argv[i]) break;
6b7353
 	}
6b7353
+	va_end(args);
6b7353
 	i = exp_spawnv(argv[0],argv+1);
6b7353
 	free((char *)argv);
6b7353
 	return(i);
6b7353
@@ -3188,6 +3198,7 @@ exp_expectl TCL_VARARGS_DEF(int,arg1)
6b7353
 		/* Ultrix 4.2 compiler refuses enumerations comparison!? */
6b7353
 		if ((int)type < 0 || (int)type >= (int)exp_bogus) {
6b7353
 			fprintf(stderr,"bad type (set %d) in exp_expectl\n",i);
6b7353
+			va_end(args);
6b7353
 			sysreturn(EINVAL);
6b7353
 		}
6b7353
 
6b7353
@@ -3253,6 +3264,7 @@ exp_fexpectl TCL_VARARGS_DEF(FILE *,arg1
6b7353
 		/* Ultrix 4.2 compiler refuses enumerations comparison!? */
6b7353
 		if ((int)type < 0 || (int)type >= (int)exp_bogus) {
6b7353
 			fprintf(stderr,"bad type (set %d) in exp_expectl\n",i);
6b7353
+			va_end(args);
6b7353
 			sysreturn(EINVAL);
6b7353
 		}
6b7353
 
6b7353
diff -up expect5.45.4/exp_log.c.orig expect5.45.4/exp_log.c
6b7353
--- expect5.45.4/exp_log.c.orig	2018-10-10 09:29:44.691617960 +0200
6b7353
+++ expect5.45.4/exp_log.c	2018-10-10 09:29:44.703617967 +0200
6b7353
@@ -174,7 +174,10 @@ expStdoutLog TCL_VARARGS_DEF(int,arg1)
6b7353
     force_stdout = TCL_VARARGS_START(int,arg1,args);
6b7353
     fmt = va_arg(args,char *);
6b7353
 
6b7353
-    if ((!tsdPtr->logUser) && (!force_stdout) && (!tsdPtr->logAll)) return;
6b7353
+    if ((!tsdPtr->logUser) && (!force_stdout) && (!tsdPtr->logAll)) {
6b7353
+	va_end(args);
6b7353
+	return;
6b7353
+    }
6b7353
 
6b7353
     (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
6b7353
     expDiagWriteBytes(bigbuf,-1);
6b7353
diff -up expect5.45.4/exp_main_sub.c.orig expect5.45.4/exp_main_sub.c
6b7353
--- expect5.45.4/exp_main_sub.c.orig	2018-02-04 11:43:58.000000000 +0100
6b7353
+++ expect5.45.4/exp_main_sub.c	2018-10-10 09:29:44.703617967 +0200
6b7353
@@ -57,6 +57,7 @@ int exp_cmdlinecmds = FALSE;
6b7353
 int exp_interactive =  FALSE;
6b7353
 int exp_buffer_command_input = FALSE;/* read in entire cmdfile at once */
6b7353
 int exp_fgets();
6b7353
+int exp_tty_cooked_echo(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo);
6b7353
 
6b7353
 Tcl_Interp *exp_interp;	/* for use by signal handlers who can't figure out */
6b7353
 			/* the interpreter directly */
6b7353
diff -up expect5.45.4/pty_termios.c.orig expect5.45.4/pty_termios.c
6b7353
--- expect5.45.4/pty_termios.c.orig	2018-02-02 20:15:52.000000000 +0100
6b7353
+++ expect5.45.4/pty_termios.c	2018-10-10 09:29:44.703617967 +0200
6b7353
@@ -105,6 +105,7 @@ with openpty which supports 4000 while p
6b7353
 
6b7353
 void expDiagLog();
6b7353
 void expDiagLogPtr();
6b7353
+char *expErrnoMsg(int errorNo);
6b7353
 
6b7353
 #include <errno.h>
6b7353
 /*extern char *sys_errlist[];*/
6b7353
@@ -189,6 +190,7 @@ static char slave_name[MAXPTYNAMELEN];
6b7353
 #endif /* HAVE_SCO_CLIST_PTYS */
6b7353
 
6b7353
 #ifdef HAVE_OPENPTY
6b7353
+#include <pty.h>
6b7353
 static char master_name[64];
6b7353
 static char slave_name[64];
6b7353
 #endif