Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-11-01 20:28:59 +0400
committerVicent Marti <tanoku@gmail.com>2013-11-01 20:30:41 +0400
commitb22593fb6444f4469445e1af2a786c8d13ee4828 (patch)
treeb90250803e24452744979fabdeb711d1c3794919 /src/config_file.c
parent653ec420f9db9924e669a749d7c4e226f824a1d2 (diff)
config_file: Style fixes
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 5f36a3f8b..6abf60621 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -125,7 +125,7 @@ static int cvar_length(cvar_t *var)
int length = 0;
while (var) {
- length += 1;
+ length++;
var = var->next;
}
@@ -579,16 +579,16 @@ static int config_delete_multivar(git_config_backend *cfg, const char *name, con
GITERR_CHECK_ALLOC(to_delete);
to_delete_idx = 0;
- for (;;) {
- cvar_t *var_next = var->next;
+ while (var != NULL) {
+ cvar_t *next = var->next;
if (regexec(&preg, var->entry->value, 0, NULL, 0) == 0) {
// If we are past the head, reattach previous node to next one,
// otherwise set the new head for the strmap.
if (prev != NULL) {
- prev->next = var_next;
+ prev->next = next;
} else {
- new_head = var_next;
+ new_head = next;
}
to_delete[to_delete_idx++] = var;
@@ -596,10 +596,7 @@ static int config_delete_multivar(git_config_backend *cfg, const char *name, con
prev = var;
}
- if (var_next == NULL)
- break;
-
- var = var_next;
+ var = next;
}
if (new_head != NULL) {