game localization: skip commented out and emplty lines

This commit is contained in:
Denis Pauk 2024-09-15 18:27:21 +03:00
parent 3a5d0afea5
commit ce98c8a957

View file

@ -89,7 +89,7 @@ LocalizationInit(void)
size_t linesize = 0; size_t linesize = 0;
linesize = strcspn(curr, "\n\r"); linesize = strcspn(curr, "\n\r");
if (strncmp(curr, "//", 2) && if (*curr && strncmp(curr, "//", 2) &&
*curr != '\n' && *curr != '\r') *curr != '\n' && *curr != '\r')
{ {
nlocalmessages ++; nlocalmessages ++;
@ -117,7 +117,10 @@ LocalizationInit(void)
linesize = strcspn(curr, "\n"); linesize = strcspn(curr, "\n");
/* skip lines with both endline codes */ /* skip lines with both endline codes */
if (*curr && *curr != ';')
{
nlocalmessages ++; nlocalmessages ++;
}
curr += linesize; curr += linesize;
if (curr >= (buf_level + len_level)) if (curr >= (buf_level + len_level))
{ {