All pastes #384800 Raw Edit

Mine

public text v1 · immutable
#384800 ·published 2007-03-07 10:38 UTC
rendered paste body
static int compare(const void *p1, const void *p2)
{
    struct tempbuf_searchidx *e1 = (struct tempbuf_searchidx *)p1;
    struct tempbuf_searchidx *e2 = (struct tempbuf_searchidx *)p2;
    
    if (strcmp(e1->str, UNTAGGED) == 0)
    {
        if (strcmp(e2->str, UNTAGGED) == 0)
            return 0;
        return -1;
    }
    else if (strcmp(e2->str, UNTAGGED) == 0)
        return 1;
    
    return strncasecmp(e1->str, e2->str, TAG_MAXLEN);
}