fix: use $USERNAME guaranteed to always be defined in zsh

Fixes #9701
This commit is contained in:
Marc Cornellà
2021-03-25 12:08:00 +01:00
parent 95a06f3927
commit 02d07f3e3d
15 changed files with 30 additions and 30 deletions

View File

@ -20,8 +20,8 @@ _emacsfun()
# tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh)
if [ "$#" -ge "2" -a "$2" = "-" ]
then
tempfile="$(mktemp --tmpdir emacs-stdin-$USER.XXXXXXX 2>/dev/null \
|| mktemp -t emacs-stdin-$USER)" # support BSD mktemp
tempfile="$(mktemp --tmpdir emacs-stdin-$USERNAME.XXXXXXX 2>/dev/null \
|| mktemp -t emacs-stdin-$USERNAME)" # support BSD mktemp
cat - > "$tempfile"
_emacsfun --no-wait $tempfile
else