diff options
author | P. J. McDermott <pjm@nac.net> | 2012-09-09 17:10:13 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-09-09 17:10:13 (EDT) |
commit | 01cd33a44eaf9f92d748a3b92ff3cd84e8b45454 (patch) | |
tree | d63204bd97dadb5c8a71d9eafc3e946ba9166668 /lib/locale.sh | |
parent | 714f7e1115e937f1f1bb0618aee358af86be0a78 (diff) |
Return rather than print value in _ob_return.
Don't use _ob_return in command substitutions. Doing so unsets stack
variables only in a subshell environment.
Diffstat (limited to 'lib/locale.sh')
-rw-r--r-- | lib/locale.sh | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/lib/locale.sh b/lib/locale.sh index 2bde6e0..53baa42 100644 --- a/lib/locale.sh +++ b/lib/locale.sh @@ -31,11 +31,13 @@ ob_get_text_domain() _ob_local if [ ${#} -ne 0 ]; then - return $(_ob_return 125) + _ob_return 125 + return ${?} fi echo "${_OB_TEXT_DOMAIN}" - return $(_ob_return 0) + _ob_return 0 + return ${?} } ob_set_text_domain() @@ -45,7 +47,8 @@ ob_set_text_domain() if [ ${#} -eq 1 ]; then _OB_TEXT_DOMAIN="${1}" else - return $(_ob_return 125) + _ob_return 125 + return ${?} fi # Make sure LC_MESSAGES is set. @@ -67,12 +70,14 @@ ob_set_text_domain() if ! _ob_try_load_messages "${_OB_DEFAULT_LOCALE}"; then ob_warn 'Cannot load messages in "%s" domain.' \ "${_OB_TEXT_DOMAIN}" - return $(_ob_return 1) + _ob_return 1 + return ${?} fi fi fi - return $(_ob_return 0) + _ob_return 0 + return ${?} } ob_set_locale_path() @@ -82,12 +87,14 @@ ob_set_locale_path() if [ ${#} -eq 1 ]; then _obslp_format="${1}" else - return $(_ob_return 125) + _ob_return 125 + return ${?} fi _OB_LOCALE_PATH="${_obslp_format}" - return $(_ob_return 0) + _ob_return 0 + return ${?} } ob_get_msg() @@ -97,12 +104,14 @@ ob_get_msg() if [ ${#} -eq 1 ]; then _obgm_msgid="${1}" else - return $(_ob_return 125) + _ob_return 125 + return ${?} fi IFS= eval echo "\$\{msg_${_OB_TEXT_DOMAIN}_${_obgm_msgid}\}" - return $(_ob_return 0) + _ob_return 0 + return ${?} } _ob_try_load_messages() @@ -116,8 +125,10 @@ _ob_try_load_messages() if [ -f "${_obtlm_ms}" ]; then . "${_obtlm_ms}" else - return $(_ob_return 1) + _ob_return 1 + return ${?} fi - return $(_ob_return 0) + _ob_return 0 + return ${?} } |