From c86ca1a9fc3bb8b09eb429458b2ecf68b62cd1de Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 6 Nov 2023 11:36:02 +0100 Subject: FLUID: '\r' (CR) is skipped when reading project files Project and code files are now always written with LF instead of CRLF, even on MSWindows machines. --- fluid/code.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'fluid/code.cxx') diff --git a/fluid/code.cxx b/fluid/code.cxx index 8651ca868..09d1eb257 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -61,7 +61,7 @@ int write_strings(const Fl_String &filename) { Fl_Widget_Type *w; int i; - FILE *fp = fl_fopen(filename.c_str(), "w"); + FILE *fp = fl_fopen(filename.c_str(), "wb"); if (!fp) return 1; switch (g_project.i18n_type) { @@ -743,22 +743,19 @@ Fl_Type* Fd_Code_Writer::write_code(Fl_Type* p) { */ int Fd_Code_Writer::write_code(const char *s, const char *t, bool to_sourceview) { write_sourceview = to_sourceview; - const char *filemode = "w"; - if (write_sourceview) - filemode = "wb"; delete id_root; id_root = 0; indentation = 0; current_class = 0L; current_widget_class = 0L; if (!s) code_file = stdout; else { - FILE *f = fl_fopen(s, filemode); + FILE *f = fl_fopen(s, "wb"); if (!f) return 0; code_file = f; } if (!t) header_file = stdout; else { - FILE *f = fl_fopen(t, filemode); + FILE *f = fl_fopen(t, "wb"); if (!f) {fclose(code_file); return 0;} header_file = f; } -- cgit v1.2.3