diff options
| -rw-r--r-- | src/naming.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/naming.c b/src/naming.c index 484e1998..9c0f09e4 100644 --- a/src/naming.c +++ b/src/naming.c @@ -94,11 +94,16 @@ Text_t valid_c_name(const char *name) { return Text$from_str(name); } +#include "stdlib/stdlib.h" public Text_t CONSTFUNC namespace_name(env_t *env, namespace_t *ns, Text_t name) { - for (; ns; ns = ns->parent) + if (Text$has(name, Text("\n"))) fail("WTF??"); + for (; ns; ns = ns->parent) { + if (strchr(ns->name, '\n')) fail("WTF"); name = Texts(ns->name, "$", name); + } if (env->id_suffix.length > 0) name = Texts(name, env->id_suffix); + if (Text$has(env->id_suffix, Text("\n"))) fail("WTF?????"); return name; } @@ -113,5 +118,6 @@ Text_t get_id_suffix(const char *filename) { Path_t id_file = Path$child(build_dir, Texts(Path$base_name(path), Text$from_str(".id"))); OptionalText_t id = Path$read(id_file); if (id.tag == TEXT_NONE) err(1, "Could not read ID file: %s", Path$as_c_string(id_file)); + id = Text$trim(id, Text(" \r\n"), true, true); return Texts("$", id); } |
