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

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