for ( p = s - 1; p > line && nsString::IsSpace( *p ); p-- ) {
for ( p = s - 1; p > line && nsCRT::IsAsciiSpace( *p ); p-- ) {
nsresult AddressBookParser::str_parse_line(    char    *line,    char    **type,    char    **value,    int        *vlen){    char    *p, *s, *d, *byte, *stop;    char    nib;    int    i, b64;    /* skip any leading space */    while ( IS_SPACE( *line ) ) {        line++;    }    *type = line;    for ( s = line; *s && *s != ':'; s++ )        ;    /* NULL */    if ( *s == '\0' ) {        return NS_ERROR_FAILURE;    }    /* trim any space between type and : */    for ( p = s - 1; p > line && nsString::IsSpace( *p ); p-- ) {        *p = '\0';    }    *s++ = '\0';    /* check for double : - indicates base 64 encoded value */    if ( *s == ':' ) {        s++;        b64 = 1;    /* single : - normally encoded value */    } else {        b64 = 0;    }    /* skip space between : and value */    while ( IS_SPACE( *s ) ) {        s++;    }    /* if no value is present, error out */    if ( *s == '\0' ) {        return NS_ERROR_FAILURE;    }    /* check for continued line markers that should be deleted */    for ( p = s, d = s; *p; p++ ) {        if ( *p != CONTINUED_LINE_MARKER )            *d++ = *p;    }    *d = '\0';    *value = s;    if ( b64 ) {        stop = PL_strchr( s, '\0' );        byte = s;        for ( p = s, *vlen = 0; p < stop; p += 4, *vlen += 3 ) {            for ( i = 0; i < 3; i++ ) {                if ( p[i] != '=' && (p[i] & 0x80 ||                    b642nib[ p[i] & 0x7f ] > 0x3f) ) {                    return NS_ERROR_FAILURE;                }            }            /* first digit */            nib = b642nib[ p[0] & 0x7f ];            byte[0] = nib << 2;            /* second digit */            nib = b642nib[ p[1] & 0x7f ];            byte[0] |= nib >> 4;            byte[1] = (nib & RIGHT4) << 4;            /* third digit */            if ( p[2] == '=' ) {                *vlen += 1;                break;            }            nib = b642nib[ p[2] & 0x7f ];            byte[1] |= nib >> 2;            byte[2] = (nib & RIGHT2) << 6;            /* fourth digit */            if ( p[3] == '=' ) {                *vlen += 2;                break;            }            nib = b642nib[ p[3] & 0x7f ];            byte[2] |= nib;            byte += 3;        }        s[ *vlen ] = '\0';    } else {        *vlen = (int) (d - s);    }    return NS_OK;}