diff options
Diffstat (limited to 'fluid/io')
| -rw-r--r-- | fluid/io/Code_Writer.cxx | 28 | ||||
| -rw-r--r-- | fluid/io/String_Writer.cxx | 2 |
2 files changed, 15 insertions, 15 deletions
diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx index 357db80dd..9460a6ac0 100644 --- a/fluid/io/Code_Writer.cxx +++ b/fluid/io/Code_Writer.cxx @@ -782,7 +782,7 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { } } } - std::string loc_include, loc_conditional; + const char *loc_include, *loc_conditional; if (proj_.i18n.type==FLD_I18N_TYPE_GNU) { loc_include = proj_.i18n.gnu_include; loc_conditional = proj_.i18n.gnu_conditional; @@ -790,19 +790,19 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { loc_include = proj_.i18n.posix_include; loc_conditional = proj_.i18n.posix_conditional; } - if ((proj_.i18n.type != FLD_I18N_TYPE_NONE) && !loc_include.empty()) { - int conditional = !loc_conditional.empty(); + if ((proj_.i18n.type != FLD_I18N_TYPE_NONE) && loc_include && loc_include[0]) { + int conditional = (loc_conditional && loc_conditional[0]); if (conditional) { - write_c("#ifdef %s\n", loc_conditional.c_str()); + write_c("#ifdef %s\n", loc_conditional); indentation++; } if (loc_include[0] != '<' && loc_include[0] != '\"') - write_c("#%sinclude \"%s\"\n", indent(), loc_include.c_str()); + write_c("#%sinclude \"%s\"\n", indent(), loc_include); else - write_c("#%sinclude %s\n", indent(), loc_include.c_str()); + write_c("#%sinclude %s\n", indent(), loc_include); if (proj_.i18n.type == FLD_I18N_TYPE_POSIX) { - if (!proj_.i18n.posix_file.empty()) { - write_c("extern nl_catd %s;\n", proj_.i18n.posix_file.c_str()); + if (proj_.i18n.posix_file && proj_.i18n.posix_file[0]) { + write_c("extern nl_catd %s;\n", proj_.i18n.posix_file); } else { write_c("// Initialize I18N stuff now for menus...\n"); write_c("#%sinclude <locale.h>\n", indent()); @@ -817,9 +817,9 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { if (conditional) { write_c("#else\n"); if (proj_.i18n.type == FLD_I18N_TYPE_GNU) { - if (!proj_.i18n.gnu_function.empty()) { - write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function.c_str()); - write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function.c_str()); + if (proj_.i18n.gnu_function && proj_.i18n.gnu_function[0]) { + write_c("#%sifndef %s\n", indent(), proj_.i18n.gnu_function); + write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_function); write_c("#%sendif\n", indent()); } } @@ -831,9 +831,9 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { indentation--; write_c("#endif\n"); } - if (proj_.i18n.type == FLD_I18N_TYPE_GNU && proj_.i18n.gnu_static_function[0]) { - write_c("#ifndef %s\n", proj_.i18n.gnu_static_function.c_str()); - write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function.c_str()); + if (proj_.i18n.type == FLD_I18N_TYPE_GNU && proj_.i18n.gnu_static_function && proj_.i18n.gnu_static_function[0]) { + write_c("#ifndef %s\n", proj_.i18n.gnu_static_function); + write_c("#%sdefine %s(text) text\n", indent_plus(1), proj_.i18n.gnu_static_function); write_c("#endif\n"); } } diff --git a/fluid/io/String_Writer.cxx b/fluid/io/String_Writer.cxx index cf59935aa..3066aa97b 100644 --- a/fluid/io/String_Writer.cxx +++ b/fluid/io/String_Writer.cxx @@ -115,7 +115,7 @@ int fld::io::write_strings(Project &proj, const std::string &filename) { case FLD_I18N_TYPE_POSIX : /* POSIX catgets, put a .msg file out */ fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n", FL_VERSION); - fprintf(fp, "$set %s\n", proj.i18n.posix_set.c_str()); + fprintf(fp, "$set %s\n", proj.i18n.posix_set); fputs("$quote \"\n", fp); for (i = 1, p = proj.tree.first; p; p = p->next) { |
