summaryrefslogtreecommitdiff
path: root/grep.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-09-23 09:47:05 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-23 09:47:05 -0700
commit28ecef4c84af0b3300b84e73d2a7749e9a4ac83f (patch)
treea49ccba002c03112965e659fe84d197869abab53 /grep.h
parentThe seventh batch (diff)
parentgrep: store grep_source buffer as const (diff)
downloadtgif-28ecef4c84af0b3300b84e73d2a7749e9a4ac83f.tar.xz
Merge branch 'jk/grep-haystack-is-read-only' into hm/paint-hits-in-log-grep
* jk/grep-haystack-is-read-only: grep: store grep_source buffer as const grep: mark "haystack" buffers as const grep: stop modifying buffer in grep_source_1() grep: stop modifying buffer in show_line() grep: stop modifying buffer in strip_timestamp
Diffstat (limited to 'grep.h')
-rw-r--r--grep.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/grep.h b/grep.h
index 128007db65..3cb8a83ae8 100644
--- a/grep.h
+++ b/grep.h
@@ -189,7 +189,7 @@ void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *orig
void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *);
void compile_grep_patterns(struct grep_opt *opt);
void free_grep_patterns(struct grep_opt *opt);
-int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size);
+int grep_buffer(struct grep_opt *opt, const char *buf, unsigned long size);
struct grep_source {
char *name;
@@ -202,7 +202,7 @@ struct grep_source {
void *identifier;
struct repository *repo; /* if GREP_SOURCE_OID */
- char *buf;
+ const char *buf;
unsigned long size;
char *path; /* for attribute lookups */