about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-09-29 14:55:49 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-09-29 14:55:49 -0700
commit736eb433bae71a162f8b5adbd42710bb718a3c91 (patch)
tree28dca749a51600b1de4394dcf4595b2fe853226d /Src/exec.c
parente61ed2b80d60ca095006d7512f90c07e6c572ee0 (diff)
downloadzsh-736eb433bae71a162f8b5adbd42710bb718a3c91.tar.gz
zsh-736eb433bae71a162f8b5adbd42710bb718a3c91.tar.xz
zsh-736eb433bae71a162f8b5adbd42710bb718a3c91.zip
39507: TMPSUFFIX for =(...)
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);