umask: Correctly handle empty symbolic value

Simple return/echo confusion.

Fixes #10177
This commit is contained in:
Fabian Boehm 2023-12-31 19:36:42 +01:00
parent 850c57bbb3
commit b895cf49ca
2 changed files with 9 additions and 1 deletions

View File

@ -39,7 +39,8 @@ set __fish_umask_set_table 6 5 4 3 2 1 0
function __fish_umask_set function __fish_umask_set
set -l to_set $argv[1] set -l to_set $argv[1]
if test $to_set -eq 0 if test $to_set -eq 0
return 7 echo 7
return
end end
echo $__fish_umask_set_table[$to_set] echo $__fish_umask_set_table[$to_set]
end end

View File

@ -89,3 +89,10 @@ umask
umask -S umask -S
#CHECK: 0222 #CHECK: 0222
#CHECK: u=rx,g=rx,o=rx #CHECK: u=rx,g=rx,o=rx
umask u=rwx,g=rwx,o=
umask
#CHECK: 0007
umask u=rwx,g=,o=rwx
umask
#CHECK: 0070