~sourcemage/quill

075f27e0684b97f61ad969f6eedb9d43e3bec87a — Ismael Luceno 2 years ago 4008252 master
quill: Avoid signal-handler in URL input loops

BASH changed the context of signal handlers, and now they can't break
out of loops in the triggering context.

It's use has always been a hack, so signal the user wish to ignore the
checks via an empty input string instead.
1 files changed, 7 insertions(+), 3 deletions(-)

M usr/bin/quill
M usr/bin/quill => usr/bin/quill +7 -3
@@ 356,14 356,18 @@ else # no updates, we'll be making a spell
  done
  query_spell_source_url
  # the semirandom fallback url is there to circumvent sorcery bug #13729
  trap break INT
  while ! url_verify "${SPELL_SRC_URL:-ftp://34tqgsad}" > /dev/null; do
    error_msg "Invalid URL!\n"
    message "If you're sure it is ok or want to skip this check, just hit ^C (ctrl-c)."
    message "Leave blank if you're sure it is ok or want to skip this check."
    old="$SPELL_SRC_URL"
    unset SPELL_SRC_URL
    query_spell_source_url
    if [ -z "$SPELL_SRC_URL" ]; then
      SPELL_SRC_URL="$old"
      break
    fi
  done
  trap INT
  unset old

  query_spell_license
  query_spell_url