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

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