*/
nextp = &init_action_list;
while ((a = *nextp) != NULL) {
- /* Don't enter action if it's already in the list,
+ /* Don't enter action if it's already in the list.
* This prevents losing running RESPAWNs.
*/
if (strcmp(a->command, command) == 0
while (*nextp != NULL)
nextp = &(*nextp)->next;
a->next = NULL;
- break;
+ goto append;
}
nextp = &a->next;
}
- if (!a)
- a = xzalloc(sizeof(*a));
+ a = xzalloc(sizeof(*a));
+
/* Append to the end of the list */
+ append:
*nextp = a;
a->action_type = action_type;
safe_strncpy(a->command, command, sizeof(a->command));