diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-10-30 00:56:30 +0100 |
|---|---|---|
| committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-11-26 22:15:00 +0100 |
| commit | 99cb64c31ab06352feecbb7a005a32339205a344 (patch) | |
| tree | 518ba9f82fbd1e64d8dad13618b6800f28721b83 /strbuf.c | |
| parent | Yet another batch of post 2.45.2 updates from the 'master' front (diff) | |
| parent | Git 2.44.3 (diff) | |
| download | git-99cb64c31ab06352feecbb7a005a32339205a344.tar.gz git-99cb64c31ab06352feecbb7a005a32339205a344.zip | |
Sync with 2.44.3
* maint-2.44:
Git 2.44.3
Git 2.43.6
Git 2.42.4
Git 2.41.3
Git 2.40.4
credential: disallow Carriage Returns in the protocol by default
credential: sanitize the user prompt
credential_format(): also encode <host>[:<port>]
t7300: work around platform-specific behaviour with long paths on MinGW
compat/regex: fix argument order to calloc(3)
mingw: drop bogus (and unneeded) declaration of `_pgmptr`
ci: remove 'Upload failed tests' directories' step from linux32 jobs
Diffstat (limited to 'strbuf.c')
| -rw-r--r-- | strbuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -486,7 +486,9 @@ void strbuf_add_percentencode(struct strbuf *dst, const char *src, int flags) unsigned char ch = src[i]; if (ch <= 0x1F || ch >= 0x7F || (ch == '/' && (flags & STRBUF_ENCODE_SLASH)) || - strchr(URL_UNSAFE_CHARS, ch)) + ((flags & STRBUF_ENCODE_HOST_AND_PORT) ? + !isalnum(ch) && !strchr("-.:[]", ch) : + !!strchr(URL_UNSAFE_CHARS, ch))) strbuf_addf(dst, "%%%02X", (unsigned char)ch); else strbuf_addch(dst, ch); |
