mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
Bugfix: always compile isdefinition(), but if dl lists
are not defined, #ifdef it to return 0 (bug reported by Mark Raddatz.)
This commit is contained in:
+4
-4
@@ -331,18 +331,20 @@ ishdr(Line *t, int *htyp)
|
||||
}
|
||||
|
||||
|
||||
#if DL_TAG_EXTENSION
|
||||
static int
|
||||
isdefinition(Line *t)
|
||||
{
|
||||
#if DL_TAG_EXTENSION
|
||||
return t && t->next
|
||||
&& (S(t->text) > 2)
|
||||
&& (t->dle == 0)
|
||||
&& (T(t->text)[0] == '=')
|
||||
&& (T(t->text)[S(t->text)-1] == '=')
|
||||
&& ( (t->next->dle >= 4) || isdefinition(t->next) );
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
@@ -354,12 +356,10 @@ islist(Line *t, int *trim)
|
||||
if ( iscode(t) || blankline(t) || ishdr(t,&i) || ishr(t) )
|
||||
return 0;
|
||||
|
||||
#if DL_TAG_EXTENSION
|
||||
if ( isdefinition(t) ) {
|
||||
*trim = 4;
|
||||
return DL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( strchr("*-+", T(t->text)[t->dle]) && isspace(T(t->text)[t->dle+1]) ) {
|
||||
i = nextnonblank(t, t->dle+1);
|
||||
|
||||
Reference in New Issue
Block a user