changeset 23:ce077dec4459 tip

fix dealing with newlines
author paulo
date Tue, 05 Aug 2014 02:05:34 -0700
parents b18d74b37e9e
children
files rcg.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/rcg.c	Wed Jul 30 01:13:50 2014 -0700
     1.2 +++ b/rcg.c	Tue Aug 05 02:05:34 2014 -0700
     1.3 @@ -249,6 +249,8 @@
     1.4  				so = 0;
     1.5  				eo = out_len - 1;
     1.6  				match_len = eo - so;
     1.7 +				if (buf[eo - 1] == '\n')
     1.8 +					match_len -= 1;
     1.9  			}
    1.10  
    1.11  			if (re_err != REG_NOMATCH && so >= 0 && eo >= 0 && match_len > 0)