瀏覽代碼

avoid side effects in _printargs

A possible fix for https://github.com/Neilpang/acme.sh/issues/1356
martgras 7 年之前
父節點
當前提交
52351d7dc8
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      acme.sh

+ 3 - 0
acme.sh

@@ -139,6 +139,7 @@ __red() {
 }
 
 _printargs() {
+  local _exitstatus="$?"
   if [ -z "$NO_TIMESTAMP" ] || [ "$NO_TIMESTAMP" = "0" ]; then
     printf -- "%s" "[$(date)] "
   fi
@@ -148,6 +149,8 @@ _printargs() {
     printf -- "%s" "$1='$2'"
   fi
   printf "\n"
+  # return the saved exit status 
+  return "$_exitstatus"
 }
 
 _dlg_versions() {