diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-01 14:05:10 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-01 14:05:10 -0400 |
| commit | 4d59fc2987e52da0274e6b204a9d2885613f74b7 (patch) | |
| tree | 8c262f99cb6ae9b550b9f8abf0ab0477044d087a /src/tomo.c | |
| parent | 7a2c99de74f5870e1dea5b59d049678ad0ef8e44 (diff) | |
Move patterns into a module
Diffstat (limited to 'src/tomo.c')
| -rw-r--r-- | src/tomo.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -21,7 +21,6 @@ #include "stdlib/datatypes.h" #include "stdlib/integers.h" #include "stdlib/optionals.h" -#include "stdlib/patterns.h" #include "stdlib/paths.h" #include "stdlib/print.h" #include "stdlib/text.h" @@ -294,7 +293,12 @@ int main(int argc, char *argv[]) Text_t escape_lib_name(Text_t lib_name) { - return Text$replace(lib_name, Pattern("{1+ !alphanumeric}"), Text("_"), Pattern(""), false); + char *libname_id = String(lib_name); + for (char *p = libname_id; *p; p++) { + if (!isalnum(*p) && *p != '_') + *p = '_'; + } + return Text$from_str(libname_id); } Path_t build_file(Path_t path, const char *extension) |
