Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bash_completion: use eval to reset nullglob

  • Loading branch information...
commit b078bc11d7aaa9fa77d61860e87994c70682f713 1 parent 631384d
@falconindy authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 bash_completion
View
11 bash_completion
@@ -1,11 +1,10 @@
#!/bin/bash
_burp() {
- local cur prev opts categories src ng_set
+ local cur prev opts categories src ng
- # save current nullglob setting and turn it on
- ng_set=$(shopt -p nullglob)
- shopt -s nullglob
+ # nullglob avoids problems when no results are found
+ [[ ! -o nullglob ]] && { shopt -s nullglob; ng=1; }
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
@@ -36,8 +35,8 @@ _burp() {
esac
fi
- # restore the previous nullglob setting
- $ng_set
+ # restore nullglob setting
+ [[ $ng ]] && shopt -u nullglob
}
Please sign in to comment.
Something went wrong with that request. Please try again.