From ebeae219bcc4221600ffcf9b21db78d2b2f19736 Mon Sep 17 00:00:00 2001 From: Ido Abramovich Date: Thu, 2 Aug 2018 14:25:19 +0300 Subject: [PATCH] reset IFS --- forgit.plugin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forgit.plugin.sh b/forgit.plugin.sh index 30f6ea6..c023e7a 100755 --- a/forgit.plugin.sh +++ b/forgit.plugin.sh @@ -131,9 +131,10 @@ export FORGIT_GI_INDEX=${FORGIT_GI_CACHE}/.index __forgit_ignore() { [ -f $FORGIT_GI_INDEX ] || __forgit_ignore_update local preview="echo {} |awk '{print \$2}' |xargs -I% bash -c 'cat $FORGIT_GI_CACHE/% 2>/dev/null || (curl -sL https://www.gitignore.io/api/% |tee $FORGIT_GI_CACHE/%)'" - OLDIFS=$IFS + ${IFS+"false"} && unset oldifs || oldifs="$IFS" #store IFS IFS=$'\n' [[ $# -gt 0 ]] && args=($@) || args=($(cat $FORGIT_GI_INDEX |nl -nrn -w4 -s' ' |__forgit_fzf -m --preview="$preview" --preview-window="right:70%" |awk '{print $2}')) + ${oldifs+"false"} && unset IFS || IFS="$oldifs" # restore IFS test -z "$args" && return 1 local options=( '(1) Output to stdout' @@ -151,7 +152,6 @@ __forgit_ignore() { __forgit_ignore_get ${args[@]} > .gitignore ;; esac - IFS=$OLDIFS } __forgit_ignore_update() {