Skip to content

Commit

Permalink
Update regexps in mimedb to work on NetBSD. (NetBSD does not support …
Browse files Browse the repository at this point in the history
…having empty subexpressions. This bug was reported and diagnosed by Claes Nästén.

darcs-hash:20070524063728-ac50b-9377f6d2ba709e997c00d716e766a912cc1ee23e.gz
  • Loading branch information
liljencrantz committed May 24, 2007
1 parent 1c62368 commit c40eb8a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mimedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ license. Read the source code of the library for more information.
/**
Start tag for langauge-specific comment
*/
#define START_TAG "<comment *(| +xml:lang *= *(\"%s\"|'%s') *)>"
#define START_TAG "<comment( +xml:lang *= *(\"%s\"|'%s'))? *>"

/**
End tab for comment
Expand Down Expand Up @@ -434,11 +434,13 @@ static char *get_lang_re()
case '.':
case '_':
if( close )
{
*out++ = ')';
*out++ = '?';
}

close=1;
*out++ = '(';
*out++ = '|';
*out++ = *lang;
break;

Expand All @@ -448,7 +450,10 @@ static char *get_lang_re()
}

if( close )
{
*out++ = ')';
*out++ = '?';
}
*out++=0;

return buff;
Expand Down

0 comments on commit c40eb8a

Please sign in to comment.