src/console/conio.c
static int
prev_word(char *ldb_buf)
{
    int ncp, i;

    if (cp == 0)                      /* if at begin of line stop now */
        return 0;
    if (cp > cl)                      /* if past eol start at eol */
        ncp=cl+1;
    else
        ncp = cp;
    /* backup to end of previous word - i.e. skip special chars */
    for (i=ncp-1; i && !iswordc(*(ldb_buf+i)); i--) ;
    if (i == 0) {                     /* at beginning of line? */
        return cp;                    /* backup to beginning */
    }
    /* now move back through word to beginning of word */
    for ( ; i && iswordc(*(ldb_buf+i)); i--) ;
    ncp = i+1;                        /* position to first char of word */
    if (i==0 && iswordc(*ldb_buf))    /* check for beginning of line */
        ncp = 0;
    return cp-ncp;                    /* return count */
}
/* Return number of characters to get to previous word */
Return number of characters to get to previous word
Return number of characters to get to previous word
static int
prev_word(char *ldb_buf)
{
    int ncp, i;
    if (cp == 0)                      
        return 0;
    if (cp > cl)                      
        ncp=cl+1;
    else
        ncp = cp;
    for (i=ncp-1; i && !iswordc(*(ldb_buf+i)); i--) ;
    if (i == 0) {                     
        return cp;                    
    }
    for ( ; i && iswordc(*(ldb_buf+i)); i--) ;
    ncp = i+1;                        
    if (i==0 && iswordc(*ldb_buf))    
        ncp = 0;
    return cp-ncp;                    
}
static int prev_word ( char * ldb_buf ) { int ncp , i ; if ( cp == 0 ) return 0 ; if ( cp > cl ) ncp = cl + 1 ; else ncp = cp ; for ( i = ncp - 1 ; i && ! iswordc ( * ( ldb_buf + i ) ) ; i -- ) ; if ( i == 0 ) { return cp ; } for ( ; i && iswordc ( * ( ldb_buf + i ) ) ; i -- ) ; ncp = i + 1 ; if ( i == 0 && iswordc ( * ldb_buf ) ) ncp = 0 ; return cp - ncp ; }
Return number of characters to get to previous word
Return number of characters to get to previous word
/* if at begin of line stop now */ /* if past eol start at eol */ /* backup to end of previous word - i.e. skip special chars */ /* at beginning of line? */ /* backup to beginning */ /* now move back through word to beginning of word */ /* position to first char of word */ /* check for beginning of line */ /* return count */