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

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