From: Junio C Hamano Date: Fri, 10 Jan 2014 18:32:59 +0000 (-0800) Subject: Merge branch 'nd/daemon-informative-errors-typofix' X-Git-Tag: v1.9-rc0~33 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0c52457b7c6311d004d0fb1f5b7bb7d5cc6dbf4e?ds=inline;hp=-c Merge branch 'nd/daemon-informative-errors-typofix' * nd/daemon-informative-errors-typofix: daemon: be strict at parsing parameters --[no-]informative-errors --- 0c52457b7c6311d004d0fb1f5b7bb7d5cc6dbf4e diff --combined daemon.c index 7bee953de8,13608c07c6..503e03906c --- a/daemon.c +++ b/daemon.c @@@ -235,7 -235,7 +235,7 @@@ static int service_enabled static int git_daemon_config(const char *var, const char *value, void *cb) { - if (!prefixcmp(var, "daemon.") && + if (starts_with(var, "daemon.") && !strcmp(var + 7, service_looking_at->config_name)) { service_enabled = git_config_bool(var, value); return 0; @@@ -633,7 -633,7 +633,7 @@@ static int execute(void for (i = 0; i < ARRAY_SIZE(daemon_service); i++) { struct daemon_service *s = &(daemon_service[i]); int namelen = strlen(s->name); - if (!prefixcmp(line, "git-") && + if (starts_with(line, "git-") && !strncmp(s->name, line + 4, namelen) && line[namelen + 4] == ' ') { /* @@@ -1165,11 -1165,11 +1165,11 @@@ int main(int argc, char **argv for (i = 1; i < argc; i++) { char *arg = argv[i]; - if (!prefixcmp(arg, "--listen=")) { + if (starts_with(arg, "--listen=")) { string_list_append(&listen_addr, xstrdup_tolower(arg + 9)); continue; } - if (!prefixcmp(arg, "--port=")) { + if (starts_with(arg, "--port=")) { char *end; unsigned long n; n = strtoul(arg+7, &end, 0); @@@ -1199,19 -1199,19 +1199,19 @@@ export_all_trees = 1; continue; } - if (!prefixcmp(arg, "--access-hook=")) { + if (starts_with(arg, "--access-hook=")) { access_hook = arg + 14; continue; } - if (!prefixcmp(arg, "--timeout=")) { + if (starts_with(arg, "--timeout=")) { timeout = atoi(arg+10); continue; } - if (!prefixcmp(arg, "--init-timeout=")) { + if (starts_with(arg, "--init-timeout=")) { init_timeout = atoi(arg+15); continue; } - if (!prefixcmp(arg, "--max-connections=")) { + if (starts_with(arg, "--max-connections=")) { max_connections = atoi(arg+18); if (max_connections < 0) max_connections = 0; /* unlimited */ @@@ -1221,7 -1221,7 +1221,7 @@@ strict_paths = 1; continue; } - if (!prefixcmp(arg, "--base-path=")) { + if (starts_with(arg, "--base-path=")) { base_path = arg+12; continue; } @@@ -1229,7 -1229,7 +1229,7 @@@ base_path_relaxed = 1; continue; } - if (!prefixcmp(arg, "--interpolated-path=")) { + if (starts_with(arg, "--interpolated-path=")) { interpolated_path = arg+20; continue; } @@@ -1241,11 -1241,11 +1241,11 @@@ user_path = ""; continue; } - if (!prefixcmp(arg, "--user-path=")) { + if (starts_with(arg, "--user-path=")) { user_path = arg + 12; continue; } - if (!prefixcmp(arg, "--pid-file=")) { + if (starts_with(arg, "--pid-file=")) { pid_file = arg + 11; continue; } @@@ -1254,35 -1254,35 +1254,35 @@@ log_syslog = 1; continue; } - if (!prefixcmp(arg, "--user=")) { + if (starts_with(arg, "--user=")) { user_name = arg + 7; continue; } - if (!prefixcmp(arg, "--group=")) { + if (starts_with(arg, "--group=")) { group_name = arg + 8; continue; } - if (!prefixcmp(arg, "--enable=")) { + if (starts_with(arg, "--enable=")) { enable_service(arg + 9, 1); continue; } - if (!prefixcmp(arg, "--disable=")) { + if (starts_with(arg, "--disable=")) { enable_service(arg + 10, 0); continue; } - if (!prefixcmp(arg, "--allow-override=")) { + if (starts_with(arg, "--allow-override=")) { make_service_overridable(arg + 17, 1); continue; } - if (!prefixcmp(arg, "--forbid-override=")) { + if (starts_with(arg, "--forbid-override=")) { make_service_overridable(arg + 18, 0); continue; } - if (starts_with(arg, "--informative-errors")) { + if (!strcmp(arg, "--informative-errors")) { informative_errors = 1; continue; } - if (starts_with(arg, "--no-informative-errors")) { + if (!strcmp(arg, "--no-informative-errors")) { informative_errors = 0; continue; }