Commit d08f45a7 authored by Matt Mascarenhas's avatar Matt Mascarenhas

hmml_to_html.c: Fix integration [#25]

parent 811abe62
#if 0
ctime -begin ${0%.*}.ctm
gcc -g -Wall -fsanitize=address -std=c99 $0 -o ${0%.*} hmml.a
gcc -g -Wall -fsanitize=address -std=c99 -pipe $0 -o ${0%.*} hmml.a
ctime -end ${0%.*}.ctm
exit
#endif
......@@ -179,6 +179,7 @@ CopyStringNoFormat(char *Dest, char *String)
*Dest++ = *String++;
++Length;
}
*Dest = '\0';
return Length;
}
......@@ -2431,7 +2432,7 @@ HMML.metadata.project);
(TemplatePtr+2 - TemplateBuffer < TemplateSize && TemplatePtr[2] == '-'))
{
char *CommentStart = &OutputPtr[-1];
while(TemplatePtr - TemplateBuffer < TemplateSize && *TemplatePtr != '>')
while(TemplatePtr - TemplateBuffer < TemplateSize)
{
if(*TemplatePtr == '_')
{
......@@ -2445,11 +2446,16 @@ HMML.metadata.project);
FoundHeader = TRUE;
OutputPtr = CommentStart;
OutputPtr += CopyStringNoFormat(OutputPtr, Header.Location);
while(TemplatePtr - TemplateBuffer < TemplateSize && *TemplatePtr != '>')
while(TemplatePtr - TemplateBuffer < TemplateSize)
{
if(TemplatePtr[0] == '>' && TemplatePtr[-1] == '-' && TemplatePtr[-2] == '-')
{
break;
}
++TemplatePtr;
}
++TemplatePtr;
break;
}
else if(!(StringsDifferT(TitleTag, TemplatePtr, '\0')))
{
......@@ -2466,11 +2472,16 @@ HMML.metadata.project);
FoundTitle = TRUE;
OutputPtr = CommentStart;
OutputPtr += CopyStringNoFormat(OutputPtr, Title.Location);
while(TemplatePtr - TemplateBuffer < TemplateSize && *TemplatePtr != '>')
while(TemplatePtr - TemplateBuffer < TemplateSize)
{
if(TemplatePtr[0] == '>' && TemplatePtr[-1] == '-' && TemplatePtr[-2] == '-')
{
break;
}
++TemplatePtr;
}
++TemplatePtr;
break;
}
else if(!(StringsDifferT(PlayerTag, TemplatePtr, '\0')))
{
......@@ -2482,11 +2493,16 @@ HMML.metadata.project);
FoundPlayer = TRUE;
OutputPtr = CommentStart;
OutputPtr += CopyStringNoFormat(OutputPtr, Player.Location);
while(TemplatePtr - TemplateBuffer < TemplateSize && *TemplatePtr != '>')
while(TemplatePtr - TemplateBuffer < TemplateSize)
{
if(TemplatePtr[0] == '>' && TemplatePtr[-1] == '-' && TemplatePtr[-2] == '-')
{
break;
}
++TemplatePtr;
}
++TemplatePtr;
break;
}
else if(!(StringsDifferT(ScriptTag, TemplatePtr, '\0')))
{
......@@ -2498,11 +2514,16 @@ HMML.metadata.project);
FoundScript = TRUE;
OutputPtr = CommentStart;
OutputPtr += CopyStringNoFormat(OutputPtr, Script.Location);
while(TemplatePtr - TemplateBuffer < TemplateSize && *TemplatePtr != '>')
while(TemplatePtr - TemplateBuffer < TemplateSize)
{
if(TemplatePtr[0] == '>' && TemplatePtr[-1] == '-' && TemplatePtr[-2] == '-')
{
break;
}
++TemplatePtr;
}
++TemplatePtr;
break;
}
}
*OutputPtr++ = *TemplatePtr++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment