aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-16 17:20:25 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-16 17:20:25 +1300
commitfc979ccde3771526433e40401e938fda45f0e028 (patch)
treeff441795030536a6617dea88d9a09578e7e0406f
parentStrip trailing blank lines (diff)
downloadmgrep-master.tar.gz
mgrep-master.zip
Use loop short-circuitHEADmaster
-rwxr-xr-xmgrep5
1 files changed, 2 insertions, 3 deletions
diff --git a/mgrep b/mgrep
index d57f9b5..aa1196e 100755
--- a/mgrep
+++ b/mgrep
@@ -87,9 +87,8 @@ done
# patterns from it. If it doesn't exist, just continue on.
if [[ -e $exclude ]] ; then
while read -r exclusion ; do
- if [[ $exclusion ]] ; then
- find_args=("${find_args[@]}" '!' '-name' "$exclusion")
- fi
+ [[ -n $exclusion ]] || continue
+ find_args=("${find_args[@]}" '!' '-name' "$exclusion")
done < "$exclude"
fi