Skip to content

Commit 2fb6a18

Browse files
peffgitster
authored andcommitted
http: add const to fix strchr() warnings
The "path" field of a "struct repo" (a custom http-push struct, not to be confused with "struct repository) is a pointer into a const argv string, and is never written to. The compiler does not traditionally complain about assigning from a const pointer because it happens via strchr(). But with some C23 libc versions (notably recent glibc), it has started to do so. Let's mark the field as const to silence the warnings. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2b9665c commit 2fb6a18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

http-push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static struct object_list *objects;
9999

100100
struct repo {
101101
char *url;
102-
char *path;
102+
const char *path;
103103
int path_len;
104104
int has_info_refs;
105105
int can_update_info_refs;

0 commit comments

Comments
 (0)