aboutsummaryrefslogtreecommitdiff
path: root/gitk-git
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2026-03-26 15:23:20 -0400
committerJunio C Hamano <gitster@pobox.com>2026-03-26 12:47:17 -0700
commitd385845d55e0e3a775fc47ac8d73a5ec41308db3 (patch)
tree8d84f5e690c66a852ce6afebf067e79f82df0067 /gitk-git
parent213b2138770d820bc28fde839f3e4df90a5d5d81 (diff)
downloadgit-d385845d55e0e3a775fc47ac8d73a5ec41308db3.tar.xz
config: store allocated string in non-const pointer
When git-config matches a url, we copy the variable section name and store it in the "section" member of a urlmatch_config struct. That member is const, since the url-matcher will not touch it (and other callers really will have a const string). But that means that we have only a const pointer to our allocated string. We have to cast away the constness when we free it, and likewise when we assign NUL to tie off the "." separating the subsection and key. This latter happens implicitly via a strchr() call, but recent versions of glibc have added annotations that let the compiler detect that and complain. Let's keep our own "section" pointer for the non-const string, and then just point config.section at it. That avoids all of the casting, both explicit and implicit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitk-git')
0 files changed, 0 insertions, 0 deletions