why does this while loop never end?
while (token != NULL) {
    if (token[0] != '\t' && (isspace(token[0]) == 0) && (strcmp(token, ":") != 0)) {
        if (head == NULL) {
            r = malloc(sizeof(Rule));
            r->target = strdup(token);
            r->dependencies = NULL;
            r->actions = NULL;
            r->next_rule = NULL;
            head = r;
            curr = head;
        }

        if (curr->dependencies == NULL) {
            dep = malloc(sizeof(Dependency));

            if (strcmp(curr->target, token) != 0) {
                r = malloc(sizeof(Rule));
                r->target = strdup(token);
                r->dependencies = NULL;
                r->actions = NULL;
                r->next_rule = NULL;
                dep->next_dep = NULL;
                dep->rule = r;
                printf("%s\n", dep->rule->target);
                curr->dependencies = dep;
            }

        } else {
            while (curr->dependencies->next_dep != NULL) {
                curr->dependencies = curr->dependencies->next_dep;
            }

            r = malloc(sizeof(Rule));
            r->target = strdup(token);
            r->actions = NULL;
            r->next_rule = NULL;
            dep->next_dep = NULL;
            dep->rule = r;
            curr->dependencies->next_dep = dep;
            printf("%s\n", curr->dependencies->next_dep->rule->target);
        }
    }

    token = strtok(NULL, " ");
}
}