summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2007-02-26 01:20:42 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2007-02-26 01:20:42 -0800
commit048f48a2fdefdf71e7af19ec7111000ce2ebf52e (patch)
treeee91b56c9071972b1585fa65838da5748c0abfd9 /daemon.c
parentFix typo: do not show name1 when name2 fails (diff)
parentDocumentation: link in 1.5.0.2 material to the top documentation page. (diff)
downloadtgif-048f48a2fdefdf71e7af19ec7111000ce2ebf52e.tar.xz
Merge branch 'master' into js/diff-ni
* master: (201 commits) Documentation: link in 1.5.0.2 material to the top documentation page. Documentation: document remote.<name>.tagopt GIT 1.5.0.2 git-remote: support remotes with a dot in the name Documentation: describe "-f/-t/-m" options to "git-remote add" diff --cc: fix display of symlink conflicts during a merge. merge-recursive: fix longstanding bug in merging symlinks merge-index: fix longstanding bug in merging symlinks diff --cached: give more sensible error message when HEAD is yet to be created. Update tests to use test-chmtime Add test-chmtime: a utility to change mtime on files Add Release Notes to prepare for 1.5.0.2 Allow arbitrary number of arguments to git-pack-objects rerere: do not deal with symlinks. rerere: do not skip two conflicted paths next to each other. Don't modify CREDITS-FILE if it hasn't changed. diff-patch: Avoid emitting double-slashes in textual patch. Reword git-am 3-way fallback failure message. Limit filename for format-patch core.legacyheaders: Use the description used in RelNotes-1.5.0 ...
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/daemon.c b/daemon.c
index 66f8d6f03d..e74ecac952 100644
--- a/daemon.c
+++ b/daemon.c
@@ -286,7 +286,7 @@ static int service_enabled;
static int git_daemon_config(const char *var, const char *value)
{
- if (!strncmp(var, "daemon.", 7) &&
+ if (!prefixcmp(var, "daemon.") &&
!strcmp(var + 7, service_looking_at->config_name)) {
service_enabled = git_config_bool(var, value);
return 0;
@@ -562,7 +562,7 @@ static int execute(struct sockaddr *addr)
for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
struct daemon_service *s = &(daemon_service[i]);
int namelen = strlen(s->name);
- if (!strncmp("git-", line, 4) &&
+ if (!prefixcmp(line, "git-") &&
!strncmp(s->name, line + 4, namelen) &&
line[namelen + 4] == ' ') {
/*
@@ -1011,7 +1011,7 @@ int main(int argc, char **argv)
for (i = 1; i < argc; i++) {
char *arg = argv[i];
- if (!strncmp(arg, "--listen=", 9)) {
+ if (!prefixcmp(arg, "--listen=")) {
char *p = arg + 9;
char *ph = listen_addr = xmalloc(strlen(arg + 9) + 1);
while (*p)
@@ -1019,7 +1019,7 @@ int main(int argc, char **argv)
*ph = 0;
continue;
}
- if (!strncmp(arg, "--port=", 7)) {
+ if (!prefixcmp(arg, "--port=")) {
char *end;
unsigned long n;
n = strtoul(arg+7, &end, 0);
@@ -1045,11 +1045,11 @@ int main(int argc, char **argv)
export_all_trees = 1;
continue;
}
- if (!strncmp(arg, "--timeout=", 10)) {
+ if (!prefixcmp(arg, "--timeout=")) {
timeout = atoi(arg+10);
continue;
}
- if (!strncmp(arg, "--init-timeout=", 15)) {
+ if (!prefixcmp(arg, "--init-timeout=")) {
init_timeout = atoi(arg+15);
continue;
}
@@ -1057,11 +1057,11 @@ int main(int argc, char **argv)
strict_paths = 1;
continue;
}
- if (!strncmp(arg, "--base-path=", 12)) {
+ if (!prefixcmp(arg, "--base-path=")) {
base_path = arg+12;
continue;
}
- if (!strncmp(arg, "--interpolated-path=", 20)) {
+ if (!prefixcmp(arg, "--interpolated-path=")) {
interpolated_path = arg+20;
continue;
}
@@ -1073,11 +1073,11 @@ int main(int argc, char **argv)
user_path = "";
continue;
}
- if (!strncmp(arg, "--user-path=", 12)) {
+ if (!prefixcmp(arg, "--user-path=")) {
user_path = arg + 12;
continue;
}
- if (!strncmp(arg, "--pid-file=", 11)) {
+ if (!prefixcmp(arg, "--pid-file=")) {
pid_file = arg + 11;
continue;
}
@@ -1086,27 +1086,27 @@ int main(int argc, char **argv)
log_syslog = 1;
continue;
}
- if (!strncmp(arg, "--user=", 7)) {
+ if (!prefixcmp(arg, "--user=")) {
user_name = arg + 7;
continue;
}
- if (!strncmp(arg, "--group=", 8)) {
+ if (!prefixcmp(arg, "--group=")) {
group_name = arg + 8;
continue;
}
- if (!strncmp(arg, "--enable=", 9)) {
+ if (!prefixcmp(arg, "--enable=")) {
enable_service(arg + 9, 1);
continue;
}
- if (!strncmp(arg, "--disable=", 10)) {
+ if (!prefixcmp(arg, "--disable=")) {
enable_service(arg + 10, 0);
continue;
}
- if (!strncmp(arg, "--allow-override=", 17)) {
+ if (!prefixcmp(arg, "--allow-override=")) {
make_service_overridable(arg + 17, 1);
continue;
}
- if (!strncmp(arg, "--forbid-override=", 18)) {
+ if (!prefixcmp(arg, "--forbid-override=")) {
make_service_overridable(arg + 18, 0);
continue;
}