diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-10-30 00:27:52 +0100 |
|---|---|---|
| committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-11-26 22:14:57 +0100 |
| commit | 676cddebf94fab8defe704b2f58c5b59912bb40c (patch) | |
| tree | 7c2cc30d8966d5bcd618b977a624f4aaa2bf3555 /strbuf.c | |
| parent | Git 2.41.2 (diff) | |
| parent | Git 2.40.4 (diff) | |
| download | git-676cddebf94fab8defe704b2f58c5b59912bb40c.tar.gz git-676cddebf94fab8defe704b2f58c5b59912bb40c.zip | |
Sync with 2.40.4
* maint-2.40:
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
@@ -500,7 +500,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); |
