Skip to content

Commit

Permalink
Make sure at least group 1 matches when looking for a header, as grou…
Browse files Browse the repository at this point in the history
…p 0 will be entire string (not matched section)
  • Loading branch information
scraft committed Aug 2, 2010
1 parent 6e96b27 commit 93a2909
Show file tree
Hide file tree
Showing 2 changed files with 1,989 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/headers.c
Expand Up @@ -162,7 +162,7 @@ static LIST *headers1helper(
while( fgets( buf, sizeof( buf ), f ) )
{
for( i = 0; i < rec; i++ )
if( jam_regexec( re[i], buf ) && re[i]->startp[0] )
if( jam_regexec( re[i], buf ) && re[i]->startp[1] )
{
/* Copy and terminate extracted string. */

Expand Down Expand Up @@ -313,7 +313,7 @@ headers1(
while( fgets( buf, sizeof( buf ), f ) )
{
for( i = 0; i < rec; i++ )
if( jam_regexec( re[i], buf ) && re[i]->startp[0] )
if( jam_regexec( re[i], buf ) && re[i]->startp[1] )
{
/* Copy and terminate extracted string. */
// Find last matching group.
Expand Down

0 comments on commit 93a2909

Please sign in to comment.