mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-06 15:48:47 +00:00
Avoid fopen newline processing.
This commit is contained in:
+6
-1
@@ -2504,6 +2504,11 @@ MD_OutputTree_C_String(FILE *file, MD_Node *node)
|
|||||||
{
|
{
|
||||||
fprintf(file, "\\n\"\n\"");
|
fprintf(file, "\\n\"\n\"");
|
||||||
}
|
}
|
||||||
|
else if(node->string.str[i] == '\r' &&
|
||||||
|
i+1 < node->string.size && node->string.str[i+1] == '\n')
|
||||||
|
{
|
||||||
|
// NOTE(mal): Step over CR when quoting CRLF newlines
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(file, "%c", node->string.str[i]);
|
fprintf(file, "%c", node->string.str[i]);
|
||||||
@@ -2814,7 +2819,7 @@ MD_FUNCTION_IMPL MD_String8
|
|||||||
MD_LoadEntireFile(MD_String8 filename)
|
MD_LoadEntireFile(MD_String8 filename)
|
||||||
{
|
{
|
||||||
MD_String8 file_contents = {0};
|
MD_String8 file_contents = {0};
|
||||||
FILE *file = fopen((char*)MD_PushStringCopy(filename).str, "r");
|
FILE *file = fopen((char*)MD_PushStringCopy(filename).str, "rb");
|
||||||
if(file)
|
if(file)
|
||||||
{
|
{
|
||||||
fseek(file, 0, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
|
|||||||
Reference in New Issue
Block a user