Merge branch 'nd/daemon-informative-errors-typofix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Jan 2014 18:32:59 +0000 (10:32 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jan 2014 18:32:59 +0000 (10:32 -0800)
* nd/daemon-informative-errors-typofix:
daemon: be strict at parsing parameters --[no-]informative-errors

1  2 
daemon.c
diff --combined daemon.c
index 7bee953de8e67bcb02acf178f8f1451633976b90,13608c07c674171ace754154c5d1cb7dea6c5e04..503e03906c5c7f921e4d67a53835f771ea695d0c
+++ 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);
                        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 */
                        strict_paths = 1;
                        continue;
                }
 -              if (!prefixcmp(arg, "--base-path=")) {
 +              if (starts_with(arg, "--base-path=")) {
                        base_path = arg+12;
                        continue;
                }
                        base_path_relaxed = 1;
                        continue;
                }
 -              if (!prefixcmp(arg, "--interpolated-path=")) {
 +              if (starts_with(arg, "--interpolated-path=")) {
                        interpolated_path = arg+20;
                        continue;
                }
                        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;
                }
                        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;
                }