Skip to content

Commit 74da090

Browse files
committed
Fix IFS overwrite
1 parent 2980e9b commit 74da090

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

notes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ grep_notes() {
8787
local grep_output
8888
if [[ -t 1 ]]; then
8989
matches=$(grep --color=$GREP_COLOR -r $NOTES_DIRECTORY -in -e "$*" 2>&1)
90+
OLDIFS=$IFS
9091
IFS=$'\n'
9192
for result in $matches; do
9293
len=${#result}
9394
grep_output+="$(echo ${result})\n"
9495
done
96+
IFS=$OLDIFS
9597
else
9698
grep_output=$(grep -r "$notes_dir" -li -e "$*" 2>&1)
9799
fi
@@ -171,6 +173,7 @@ open_note() {
171173
local buffer=$@
172174
local files=()
173175

176+
OLDIFS=$IFS
174177
IFS=','
175178
for arg in $buffer; do
176179
ext_check=true
@@ -190,6 +193,7 @@ open_note() {
190193
fi
191194
files+=(${note_path})
192195
done
196+
IFS=$OLDIFS
193197

194198
$EDITOR ${files[@]} < /dev/tty
195199
}

0 commit comments

Comments
 (0)