many bugfix, fixed getopt split
This commit is contained in:
+9
-3
@@ -109,7 +109,9 @@ setlocale()
|
||||
return 1
|
||||
fi
|
||||
# Restore the getopt-normalised (shell-quoted) argument list
|
||||
eval set -- "$PARSED"
|
||||
local -a _pargs=()
|
||||
_getopt_split _pargs "$PARSED"
|
||||
set -- "${_pargs[@]}"
|
||||
while true; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
@@ -232,8 +234,12 @@ build_locale_shortcuts()
|
||||
continue
|
||||
fi
|
||||
|
||||
# Optional collision warning
|
||||
if declare -F "$fname" >/dev/null 2>&1; then
|
||||
# Collision warning. A function that already calls setlocale is one of
|
||||
# these shortcuts, typically inherited through the environment from a
|
||||
# parent shell that loaded the profile: replacing it is not worth a
|
||||
# warning at every nested shell.
|
||||
if declare -F "$fname" >/dev/null 2>&1 && \
|
||||
! declare -f "$fname" 2>/dev/null | grep -q 'setlocale'; then
|
||||
disp W "Overriding existing function '$fname'."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user