diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-11-06 11:36:02 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-11-06 11:36:02 +0100 |
| commit | c86ca1a9fc3bb8b09eb429458b2ecf68b62cd1de (patch) | |
| tree | 8c60474e660a584412fd590ef347c05ded35ac90 /fluid/code.cxx | |
| parent | acc96cdf5666a37ff87d0038af74c1af1628ca11 (diff) | |
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.
Diffstat (limited to 'fluid/code.cxx')
| -rw-r--r-- | fluid/code.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
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; } |
