Commit b22593fb by Vicent Marti

config_file: Style fixes

parent 653ec420
...@@ -125,7 +125,7 @@ static int cvar_length(cvar_t *var) ...@@ -125,7 +125,7 @@ static int cvar_length(cvar_t *var)
int length = 0; int length = 0;
while (var) { while (var) {
length += 1; length++;
var = var->next; var = var->next;
} }
...@@ -579,16 +579,16 @@ static int config_delete_multivar(git_config_backend *cfg, const char *name, con ...@@ -579,16 +579,16 @@ static int config_delete_multivar(git_config_backend *cfg, const char *name, con
GITERR_CHECK_ALLOC(to_delete); GITERR_CHECK_ALLOC(to_delete);
to_delete_idx = 0; to_delete_idx = 0;
for (;;) { while (var != NULL) {
cvar_t *var_next = var->next; cvar_t *next = var->next;
if (regexec(&preg, var->entry->value, 0, NULL, 0) == 0) { if (regexec(&preg, var->entry->value, 0, NULL, 0) == 0) {
// If we are past the head, reattach previous node to next one, // If we are past the head, reattach previous node to next one,
// otherwise set the new head for the strmap. // otherwise set the new head for the strmap.
if (prev != NULL) { if (prev != NULL) {
prev->next = var_next; prev->next = next;
} else { } else {
new_head = var_next; new_head = next;
} }
to_delete[to_delete_idx++] = var; to_delete[to_delete_idx++] = var;
...@@ -596,10 +596,7 @@ static int config_delete_multivar(git_config_backend *cfg, const char *name, con ...@@ -596,10 +596,7 @@ static int config_delete_multivar(git_config_backend *cfg, const char *name, con
prev = var; prev = var;
} }
if (var_next == NULL) var = next;
break;
var = var_next;
} }
if (new_head != NULL) { if (new_head != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment