summaryrefslogtreecommitdiff
blob: 344aa6dd2dffa3b5b946085a73fdb9d368b36cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
https://bugs.gentoo.org/103257

--- teco-orig/te_exec2.c
+++ teco/te_exec2.c
@@ -197,7 +197,7 @@
 		{
 		if (eisw)       /* if ending a file execute, restore the previous "old command string" */
 		    {
-		    fclose(eisw);               /* return the file descriptor */
+		    fclose(eisw), eisw = NULL;     /* return the file descriptor */
 		    dly_free_blist(cbuf.f);     /* return the command string used by the file (after execution done) */
 		    cbuf.f = oldcstring.f;
 		    cbuf.z = oldcstring.z;
@@ -214,7 +214,7 @@
 		oldcstring.z = cbuf.z;
 		cbuf.f = NULL;              /* and make it inaccessible to "rdcmd" */
 		}
-	    if (eisw) fclose(eisw);         /* if a command file had been open, close it */
+	    if (eisw) fclose(eisw), eisw = NULL;  /* if a command file had been open, close it */
 	    esp->val1 = (eisw = t_eisw) ? -1 : 0;
 	    esp->flag1 = colonflag;
 	    colonflag = 0;