comparison rcg.c @ 23:ce077dec4459

fix dealing with newlines
author paulo
date Tue, 05 Aug 2014 02:05:34 -0700
parents b18d74b37e9e
children
comparison
equal deleted inserted replaced
17:f74c645e65a1 18:47b7779cd857
247 if (colorLine && match_len > 0) 247 if (colorLine && match_len > 0)
248 { 248 {
249 so = 0; 249 so = 0;
250 eo = out_len - 1; 250 eo = out_len - 1;
251 match_len = eo - so; 251 match_len = eo - so;
252 if (buf[eo - 1] == '\n')
253 match_len -= 1;
252 } 254 }
253 255
254 if (re_err != REG_NOMATCH && so >= 0 && eo >= 0 && match_len > 0) 256 if (re_err != REG_NOMATCH && so >= 0 && eo >= 0 && match_len > 0)
255 { 257 {
256 size_t CLR_STRING_len = strlen(CLR_START) + strlen(clr) + strlen(CLR_END) + strlen(CLR_CLEAR); 258 size_t CLR_STRING_len = strlen(CLR_START) + strlen(clr) + strlen(CLR_END) + strlen(CLR_CLEAR);