summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2026-04-02 00:14:58 -0400
committerJunio C Hamano <gitster@pobox.com>2026-04-01 22:08:51 -0700
commit031d29d6fbf12284d391c23f04d15970c3bac11c (patch)
treec67407c135c12c1dac1137421aace5a3ee73a0bd /contrib/persistent-https
parenteedc7ecc66aefa085aae9bf51b56aa11eeb23950 (diff)
downloadgit-031d29d6fbf12284d391c23f04d15970c3bac11c.tar.gz
git-031d29d6fbf12284d391c23f04d15970c3bac11c.zip
pager: explicitly cast away strchr() constness
When we do: char *cp = strchr(argv[i], '='); it implicitly removes the constness from argv[i]. We need "cp" to remain writable (since we overwrite it with a NUL). In theory we should be able to drop the const from argv[i], because it is a sub-pointer into our duplicated pager_env variable. But we get it from split_cmdline(), which uses the traditional "const char **" type for argv. This is overly limiting, but changing it would be awkward for all the other callers of split_cmdline(). Let's do an explicit cast with a note about why it is OK. This is enough to silence compiler warnings about the implicit const problems. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions