From 5014de0541201716dc4ee6f544321ac4e3d7431e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Wed, 26 Jan 2022 14:45:50 +0100 Subject: Squashed 'gitstatus/' changes from e02d9eed..6eb490ab 6eb490ab survive broken $TMPDIR 94bf4fc2 add ppc64 support to the build script git-subtree-dir: gitstatus git-subtree-split: 6eb490ab86118ad063224e4d50b6b05bea7dd12c --- gitstatus.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gitstatus.plugin.zsh') diff --git a/gitstatus.plugin.zsh b/gitstatus.plugin.zsh index 181e756a..228fea74 100644 --- a/gitstatus.plugin.zsh +++ b/gitstatus.plugin.zsh @@ -574,7 +574,12 @@ function gitstatus_start"${1:-}"() { else typeset -gi _GITSTATUS_START_COUNTER local log_level=$GITSTATUS_LOG_LEVEL - local file_prefix=${${TMPDIR:-/tmp}:A}/gitstatus.$name.$EUID + if [[ -n "$TMPDIR" && ( ( -d "$TMPDIR" && -w "$TMPDIR" ) || ! ( -d /tmp && -w /tmp ) ) ]]; then + local tmpdir=$TMPDIR + else + local tmpdir=/tmp + fi + local file_prefix=${tmpdir:A}/gitstatus.$name.$EUID file_prefix+=.$sysparams[pid].$EPOCHSECONDS.$((++_GITSTATUS_START_COUNTER)) (( GITSTATUS_ENABLE_LOGGING )) && : ${log_level:=INFO} if [[ -n $log_level ]]; then -- cgit v1.2.3