All pastes #673914 Raw Edit

Something

public text v1 · immutable
#673914 ·published 2007-08-28 19:58 UTC
rendered paste body
NCURSES_EXPORT(void)
_nc_add_to_try(struct tries **tree, const char *str, unsigned code)
{
    static bool out_of_memory = FALSE;
    struct tries *ptr, *savedptr;
    unsigned const char *txt = (unsigned const char *) str;

    if (txt == 0 || *txt == '\0' || out_of_memory || code == 0)
        return;

    if ((*tree) != 0) {
        ptr = savedptr = (*tree);

        for (;;) {
            unsigned char cmp = *txt;

            while (!CMP_TRY(ptr->ch, cmp)
                   && ptr->sibling != 0)
                ptr = ptr->sibling;