shithub: trueawk

Download patch

ref: 0096fa60008346f24de36064930c911ced766961
parent: 230a480b2b1bae274f2c46294a8347df664a0016
author: Arnold D. Robbins <arnold@skeeve.com>
date: Mon Nov 27 13:21:03 EST 2023

Fix after review comment.

--- a/run.c
+++ b/run.c
@@ -2108,7 +2108,7 @@
 		break;
 	case FSYSTEM:
 		fflush(stdout);		/* in case something is buffered already */
-		status = system(getsval(x));
+		estatus = status = system(getsval(x));
 		if (status != -1) {
 			if (WIFEXITED(status)) {
 				estatus = WEXITSTATUS(status);
@@ -2121,6 +2121,7 @@
 			} else	/* something else?!? */
 				estatus = 0;
 		}
+		/* else estatus was set to -1 */
 		u = estatus;
 		break;
 	case FRAND:
--