Fix umask function regex

Some grep implementations complain of empty subexpression

fixes #1313
This commit is contained in:
David Xia 2014-07-29 01:43:05 -04:00
parent adabc2d7a0
commit 6d18bf5cd4

View file

@ -1,7 +1,7 @@
function __fish_umask_parse -d "Internal umask function"
# Test if already a valid octal mask, and pad it with zeros
if echo $argv | sgrep -E '^(0|)[0-7]{1,3}$' >/dev/null
if echo $argv | sgrep -E '^0?[0-7]{1,3}$' >/dev/null
set -l char_count (echo $argv| wc -c)
for i in (seq (math 5 - $char_count)); set argv 0$argv; end
echo $argv