aboutsummaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/grep.c b/grep.c
index 6c68d5bd2..7b2b96a43 100644
--- a/grep.c
+++ b/grep.c
@@ -31,14 +31,14 @@ void init_grep_defaults(void)
opt->max_depth = -1;
opt->pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED;
opt->extended_regexp_option = 0;
- strcpy(opt->color_context, "");
- strcpy(opt->color_filename, "");
- strcpy(opt->color_function, "");
- strcpy(opt->color_lineno, "");
- strcpy(opt->color_match_context, GIT_COLOR_BOLD_RED);
- strcpy(opt->color_match_selected, GIT_COLOR_BOLD_RED);
- strcpy(opt->color_selected, "");
- strcpy(opt->color_sep, GIT_COLOR_CYAN);
+ color_set(opt->color_context, "");
+ color_set(opt->color_filename, "");
+ color_set(opt->color_function, "");
+ color_set(opt->color_lineno, "");
+ color_set(opt->color_match_context, GIT_COLOR_BOLD_RED);
+ color_set(opt->color_match_selected, GIT_COLOR_BOLD_RED);
+ color_set(opt->color_selected, "");
+ color_set(opt->color_sep, GIT_COLOR_CYAN);
opt->color = -1;
}
@@ -151,14 +151,14 @@ void grep_init(struct grep_opt *opt, const char *prefix)
opt->regflags = def->regflags;
opt->relative = def->relative;
- strcpy(opt->color_context, def->color_context);
- strcpy(opt->color_filename, def->color_filename);
- strcpy(opt->color_function, def->color_function);
- strcpy(opt->color_lineno, def->color_lineno);
- strcpy(opt->color_match_context, def->color_match_context);
- strcpy(opt->color_match_selected, def->color_match_selected);
- strcpy(opt->color_selected, def->color_selected);
- strcpy(opt->color_sep, def->color_sep);
+ color_set(opt->color_context, def->color_context);
+ color_set(opt->color_filename, def->color_filename);
+ color_set(opt->color_function, def->color_function);
+ color_set(opt->color_lineno, def->color_lineno);
+ color_set(opt->color_match_context, def->color_match_context);
+ color_set(opt->color_match_selected, def->color_match_selected);
+ color_set(opt->color_selected, def->color_selected);
+ color_set(opt->color_sep, def->color_sep);
}
void grep_commit_pattern_type(enum grep_pattern_type pattern_type, struct grep_opt *opt)