Skip to content

Commit

Permalink
Make game config parser crlf agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
pingflood committed Dec 27, 2019
1 parent f3a1d4a commit 7155022
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions source/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2423,15 +2423,13 @@ int32_t parse_config_line(char *current_line, char *current_variable, char *curr

line_ptr_new = skip_spaces(line_ptr_new + 1);
strcpy(current_value, line_ptr_new);
line_ptr_new = current_value + strlen(current_value) - 1;
if(*line_ptr_new == '\n')
{
line_ptr_new--;
*line_ptr_new = 0;
}

if(*line_ptr_new == '\r')
*line_ptr_new = 0;
for (line_ptr_new = current_value; *line_ptr_new != 0; line_ptr_new++) {
if (*line_ptr_new == '\r' || *line_ptr_new == '\n') {
*line_ptr_new = 0;
break;
}
}

return 0;
}
Expand Down

0 comments on commit 7155022

Please sign in to comment.