Permalink
Browse files

PR/26: Include the line terminator character so that regex's that match

to the end of line work.
  • Loading branch information...
zoulasc committed Aug 11, 2018
1 parent 78f30ba commit b186b4a4ad8b4e6927bb7fd578db572d44bd0712
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/softmagic.c
@@ -32,7 +32,7 @@
#include "file.h"

#ifndef lint
FILE_RCSID("@(#)$File: softmagic.c,v 1.262 2018/06/22 20:39:50 christos Exp $")
FILE_RCSID("@(#)$File: softmagic.c,v 1.263 2018/08/11 11:44:24 christos Exp $")
#endif /* lint */

#include "magic.h"
@@ -1301,9 +1301,11 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|| (b = CAST(const char *,
memchr(c, '\r', CAST(size_t, (end - c))))));
lines--, b++) {
last = b;
if (b < end - 1 && b[0] == '\r' && b[1] == '\n')
b++;
if (b < end - 1 && b[0] == '\n')
b++;
last = b;
}
if (lines)
last = end;

0 comments on commit b186b4a

Please sign in to comment.