tvi: lastline() for lines starting with a \n - neatvi - [fork] simple vi-type editor with UTF-8 support
 (HTM) git clone git://src.adamsgaard.dk/neatvi
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit a183ae6d1a2a745051c1f2a45f1b4de5fcaa4d5d
 (DIR) parent fe13d22d2b7d68dfcbe6cd7317e74778993cc01f
 (HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
       Date:   Sat, 16 May 2015 17:53:51 +0430
       
       vi: lastline() for lines starting with a \n
       
       Diffstat:
         M vi.c                                |       2 +-
       
       1 file changed, 1 insertion(+), 1 deletion(-)
       ---
 (DIR) diff --git a/vi.c b/vi.c
       t@@ -659,7 +659,7 @@ static int lastline(char *str)
                char *r = s;
                while (s && s[0]) {
                        r = s;
       -                s = strchr(s == str ? s : s + 1, '\n');
       +                s = strchr(s + 1, '\n');
                }
                return r - str;
        }