cinera.c: Fix CollationBuffers->ProjectID test

This commit is contained in:
Matt Mascarenhas 2018-06-12 20:32:56 +01:00
parent 966d616b48
commit a1e8efe431
1 changed files with 6 additions and 6 deletions

View File

@ -16,7 +16,7 @@ typedef struct
version CINERA_APP_VERSION = {
.Major = 0,
.Minor = 5,
.Patch = 59
.Patch = 60
};
// TODO(matt): Copy in the DB 3 stuff from cinera_working.c
@ -3062,8 +3062,8 @@ HMMLToBuffers(buffers *CollationBuffers, template **BespokeTemplate, char *Filen
if(!StringsDiffer(ProjectInfo[ProjectIndex].ProjectID,
HMML.metadata.project))
{
CopyString(CollationBuffers->ProjectID, sizeof(CollationBuffers->ProjectID), "%s", HMML.metadata.project);
CopyString(CollationBuffers->ProjectName, sizeof(CollationBuffers->ProjectName), "%s", ProjectInfo[ProjectIndex].FullName);
CopyStringNoFormat(CollationBuffers->ProjectID, sizeof(CollationBuffers->ProjectID), HMML.metadata.project);
CopyStringNoFormat(CollationBuffers->ProjectName, sizeof(CollationBuffers->ProjectName), ProjectInfo[ProjectIndex].FullName);
break;
}
}
@ -4465,12 +4465,12 @@ BuffersToHTML(buffers *CollationBuffers, template *Template, char *OutputPath, i
case TAG_PROJECT_ID:
if(CollationBuffers->ProjectID[0] == '\0')
{
CopyStringToBufferNoFormat(&Output, CollationBuffers->ProjectID); // NOTE(matt): Not HTML-safe
fprintf(stderr, "Template contains a <!-- __CINERA_PROJECT_ID__ --> tag\n"
"Skipping just this tag, because no project ID is set\n");
}
else
{
fprintf(stderr, "Template contains a <!-- __CINERA_PROJECT_ID__ --> tag\n"
"Skipping just this tag, because no project ID is set\n");
CopyStringToBufferNoFormat(&Output, CollationBuffers->ProjectID); // NOTE(matt): Not HTML-safe
}
break;
case TAG_PROJECT: