summaryrefslogtreecommitdiff
path: root/advice.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-07-09 11:33:27 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-09 11:33:28 -0700
commite91ae32a01ffe294b8510c1d8cd7138493a0712f (patch)
tree461b9dacf6c1e8adf5f59251af093dc7c407091f /advice.c
parentline-log: use commit_list_append() instead of duplicating its code (diff)
parenthttp-push: refactor parsing of remote object names (diff)
downloadtgif-e91ae32a01ffe294b8510c1d8cd7138493a0712f.tar.xz
Merge branch 'jk/skip-prefix'
* jk/skip-prefix: http-push: refactor parsing of remote object names imap-send: use skip_prefix instead of using magic numbers use skip_prefix to avoid repeated calculations git: avoid magic number with skip_prefix fetch-pack: refactor parsing in get_ack fast-import: refactor parsing of spaces stat_opt: check extra strlen call daemon: use skip_prefix to avoid magic numbers fast-import: use skip_prefix for parsing input use skip_prefix to avoid repeating strings use skip_prefix to avoid magic numbers transport-helper: avoid reading past end-of-string fast-import: fix read of uninitialized argv memory apply: use skip_prefix instead of raw addition refactor skip_prefix to return a boolean avoid using skip_prefix as a boolean daemon: mark some strings as const parse_diff_color_slot: drop ofs parameter
Diffstat (limited to 'advice.c')
-rw-r--r--advice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/advice.c b/advice.c
index c50ebdf5fe..9b42033192 100644
--- a/advice.c
+++ b/advice.c
@@ -61,9 +61,12 @@ void advise(const char *advice, ...)
int git_default_advice_config(const char *var, const char *value)
{
- const char *k = skip_prefix(var, "advice.");
+ const char *k;
int i;
+ if (!skip_prefix(var, "advice.", &k))
+ return 0;
+
for (i = 0; i < ARRAY_SIZE(advice_config); i++) {
if (strcmp(k, advice_config[i].name))
continue;