Ticket #3390: mc-3390-backward-word-off-by-1.patch

File mc-3390-backward-word-off-by-1.patch, 484 bytes (added by egmont, 9 years ago)

Fix

  • lib/widget/input.c

    diff --git a/lib/widget/input.c b/lib/widget/input.c
    index 4ce2ddb..c8d7b74 100644
    a b backward_word (WInput * in) 
    425425    const char *p, *p_tmp; 
    426426 
    427427    for (p = in->buffer + str_offset_to_pos (in->buffer, in->point); 
    428          (p != in->buffer) && (p[0] == '\0'); str_cprev_char (&p), in->point--); 
     428         (p != in->buffer) && (p[-1] == '\0'); str_cprev_char (&p), in->point--); 
    429429 
    430430    while (p != in->buffer) 
    431431    {