diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-02-13 13:39:24 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-13 13:39:25 -0800 |
| commit | 7855effc952777f2fac284e4461743cf5aa20ee6 (patch) | |
| tree | 37cbf589a05604e1d2d3ca2aaaa6ce10867893f1 /diff.c | |
| parent | a91de2172dac7e73de2088a7fdfeb532baa3bfca (diff) | |
| parent | fc9fd8065c6049243f50e90f00a847054ca15e28 (diff) | |
| download | git-7855effc952777f2fac284e4461743cf5aa20ee6.tar.xz | |
Merge branch 'cf/c23-const-preserving-strchr-updates-0'
ISO C23 redefines strchr and friends that tradiotionally took
a const pointer and returned a non-const pointer derived from it to
preserve constness (i.e., if you ask for a substring in a const
string, you get a const pointer to the substring). Update code
paths that used non-const pointer to receive their results that did
not have to be non-const to adjust.
* cf/c23-const-preserving-strchr-updates-0:
gpg-interface: remove an unnecessary NULL initialization
global: constify some pointers that are not written to
Diffstat (limited to 'diff.c')
| -rw-r--r-- | diff.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1961,7 +1961,7 @@ static int fn_out_diff_words_write_helper(struct diff_options *o, struct strbuf sb = STRBUF_INIT; while (count) { - char *p = memchr(buf, '\n', count); + const char *p = memchr(buf, '\n', count); if (print) strbuf_addstr(&sb, diff_line_prefix(o)); @@ -3044,7 +3044,7 @@ static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir, struct dirstat_file *f = dir->files; int namelen = strlen(f->name); unsigned long changes; - char *slash; + const char *slash; if (namelen < baselen) break; |
