All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: "Kyle J. McKay" <mackyle@gmail.com>
Cc: "Git List" <git@vger.kernel.org>,
	"David Aguilar" <davvid@gmail.com>, "Petr Baudis" <pasky@ucw.cz>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Richard Hartmann" <richih.mailinglist@gmail.com>,
	"Jeff King" <peff@peff.net>,
	"Daniel Knittl-Frank" <knittl89@googlemail.com>,
	"Jan Krüger" <jk@jk.gs>, "Alejandro Mery" <amery@geeks.cl>,
	"Aaron Schrab" <aaron@schrab.com>
Subject: Re: [PATCH v5 4/5] config: improve support for http.<url>.* settings
Date: Mon, 15 Jul 2013 19:12:51 -0400	[thread overview]
Message-ID: <CAPig+cQTNXgPyD4qiQPyQeSHWY0Y=_Qnd2i9LfVqQDA1DJNDxg@mail.gmail.com> (raw)
In-Reply-To: <dcbaa11c8595f48814aa39a75ad18ea@f74d39fa044aa309eaea14b9f57fe79>

On Mon, Jul 15, 2013 at 5:51 AM, Kyle J. McKay <mackyle@gmail.com> wrote:
> Improve on the http.<url>.* url matching behavior by first
> normalizing the urls before they are compared.
>
> diff --git a/http.c b/http.c
> index 758e5b1..d04386e 100644
> --- a/http.c
> +++ b/http.c
> @@ -169,6 +169,210 @@ static void process_curl_messages(void)
>  }
>  #endif
>
> +static int append_normalized_escapes(struct strbuf *buf,
> +                                    const char *from,
> +                                    size_t from_len,
> +                                    const char *esc_extra,
> +                                    const char *esc_ok)
> +{
> +       /*
> +        * Append to strbuf buf characters from string from with length from_len

s/from string from/from string/

> +        * while unescaping characters that do not need to be escaped and
> +        * escaping characters that do.  The set of characters to escape (the
> +        * complement of which is unescaped) starts out as the RFC 3986 unsafe
> +        * characters (0x00-0x1F,0x7F-0xFF," <>\"#%{}|\\^`").  If esc_extra
> +        * is not NULL, those additional characters will also always be escaped.
> +        * If esc_ok is not NULL, those characters will be left escaped if found
> +        * that way, but will not be unescaped otherwise (used for delimiters).
> +        * If a %-escape sequence is encountered that is not followed by 2
> +        * hexadecimal digits, the sequence is invalid and false (0) will be
> +        * returned.  Otherwise true (1) will be returned for success.
> +        *
> +        * Note that all %-escape sequences will be normalized to UPPERCASE
> +        * as indicated in RFC 3986.  Unless included in esc_extra or esc_ok
> +        * alphanumerics and "-._~" will always be unescaped as per RFC 3986.
> +        */

  reply	other threads:[~2013-07-15 23:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15  9:50 [PATCH v5 0/5] config: add support for http.<url>.* settings Kyle J. McKay
2013-07-15  9:50 ` [PATCH v5 1/5] http.c: fix parsing of http.sslCertPasswordProtected variable Kyle J. McKay
2013-07-15  9:50 ` [PATCH v5 2/5] http.c: fix parsing of GIT_SSL_CERT_PASSWORD_PROTECTED variable Kyle J. McKay
2013-07-15  9:51 ` [PATCH v5 3/5] config: add support for http.<url>.* settings Kyle J. McKay
2013-07-15  9:51 ` [PATCH v5 4/5] config: improve " Kyle J. McKay
2013-07-15 23:12   ` Eric Sunshine [this message]
2013-07-16  9:53     ` Kyle J. McKay
2013-07-16 10:01       ` Eric Sunshine
2013-07-15  9:51 ` [PATCH v5 5/5] tests: add new test for the url_normalize function Kyle J. McKay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPig+cQTNXgPyD4qiQPyQeSHWY0Y=_Qnd2i9LfVqQDA1DJNDxg@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=aaron@schrab.com \
    --cc=amery@geeks.cl \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jk@jk.gs \
    --cc=knittl89@googlemail.com \
    --cc=mackyle@gmail.com \
    --cc=pasky@ucw.cz \
    --cc=peff@peff.net \
    --cc=richih.mailinglist@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.