Ticket #1481: mc-4.7.0-pre1.back_word.patch

File mc-4.7.0-pre1.back_word.patch, 824 bytes (added by angel_il, 15 years ago)
  • src/widget.c

    diff -Naur mc-4.7.0-pre1~/src/widget.c mc-4.7.0-pre1/src/widget.c
    old new  
    13251325{ 
    13261326    const char *p = in->buffer + str_offset_to_pos (in->buffer, in->point); 
    13271327 
    1328     while ((p != in->buffer) && (p[0] == '\0')) { 
    1329         p--; 
    1330         in->point--; 
    1331     } 
    1332      
    1333     while ((p != in->buffer) && (str_isspace (p) || str_ispunct (p))) { 
     1328    while ((p > in->buffer) && (str_isspace (p - 1) || str_ispunct (p - 1))) { 
    13341329        str_cprev_char (&p); 
    13351330        in->point--; 
    13361331    } 
    1337     while ((p != in->buffer) && !str_isspace (p) && !str_ispunct (p)) { 
     1332    while ((p > in->buffer) && !str_isspace (p - 1) && !str_ispunct (p - 1)) { 
    13381333        str_cprev_char (&p); 
    13391334        in->point--; 
    13401335    }