# File lib/rbreadline.rb, line 6368
  def make_quoted_replacement(match, mtype, qc)
    # If we are doing completion on quoted substrings, and any matches
    #   contain any of the completer_word_break_characters, then auto-
    #   matically prepend the substring with a quote character (just pick
    #   the first one from the list of such) if it does not already begin
    #   with a quote string.  FIXME: Need to remove any such automatically
    #   inserted quote character when it no longer is necessary, such as
    #   if we change the string we are completing on and the new set of
    #   matches don't require a quoted substring.
    replacement = match

    should_quote = match && @rl_completer_quote_characters &&
      @rl_filename_completion_desired &&
      @rl_filename_quoting_desired

    if (should_quote)
      should_quote = should_quote && (qc.nil? || qc == 0.chr ||
                                      (@rl_completer_quote_characters &&
                                       @rl_completer_quote_characters.include?(qc)))
    end

    if (should_quote)

      # If there is a single match, see if we need to quote it.
      #   This also checks whether the common prefix of several
      # matches needs to be quoted.
      should_quote = @rl_filename_quote_characters ?
        !!match[@rl_filename_quote_characters] :
        false

      do_replace = should_quote ? mtype : NO_MATCH
      # Quote the replacement, since we found an embedded
      # word break character in a potential match.
      if (do_replace != NO_MATCH && @rl_filename_quoting_function)
        replacement = send(@rl_filename_quoting_function,match, do_replace, qc)
      end
    end
    replacement
  end