diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Keep string literals behind const pointers
Git's DEVELOPER=1 build turns on -Wwrite-strings as an error, and the literals stored through plain char pointers failed cgit's own objects there. The exec filter's argv takes the cast execvp needs once, the way git's run-command does.
Diffstat (limited to '')
-rw-r--r--source/filter.h8
1 file changed, 4 insertions, 4 deletions
diff --git a/source/filter.h b/source/filter.h
index 70fa4ff..2c8e7b7 100644
--- a/source/filter.h
+++ b/source/filter.h
@@ -26,16 +26,16 @@ struct cgit_filter {
struct cgit_exec_filter {
struct cgit_filter base;
- char *cmd;
- char **argv;
+ const char *cmd;
+ const char **argv;
int old_stdout;
int pid;
};
extern struct cgit_filter *cgit_new_filter(const char *cmd,
filter_type filtertype);
-extern void cgit_exec_filter_init(struct cgit_exec_filter *filter, char *cmd,
- char **argv);
+extern void cgit_exec_filter_init(struct cgit_exec_filter *filter, const char *cmd,
+ const char **argv);
/*
* Redirect stdout into the filter and pass it the variadic arguments its type