summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 04868bd37..e253d7b9e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4421,6 +4421,15 @@ getoutputfile(char *cmd, char **eptr)
 	if (!s)
 	    child_unblock();
 	return NULL;
+    } else {
+	char *suffix = getsparam("TMPSUFFIX");
+	if (suffix && *suffix && !strstr(suffix, "/")) {
+	    suffix = dyncat(nam, unmeta(suffix));
+	    if (link(nam, suffix) == 0) {
+		addfilelist(nam, 0);
+		nam = ztrdup(suffix);
+	    }
+	}
     }
     addfilelist(nam, 0);