diff options
| author | Tyge Løvset <[email protected]> | 2022-08-15 16:54:56 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-08-15 16:54:56 +0200 |
| commit | bf3c50da1a346b56b6846c0f7b9e7a222f602c2f (patch) | |
| tree | 3284252adec60cce3bd4d7c5876fe2d8a3d9506e /examples | |
| parent | e9e405dbe1ec3eb51ce2e3398b3c24583293892e (diff) | |
| download | STC-modified-bf3c50da1a346b56b6846c0f7b9e7a222f602c2f.tar.gz STC-modified-bf3c50da1a346b56b6846c0f7b9e7a222f602c2f.zip | |
More iterator fixes. Make sure cvec/cdeq find_in() return end() iterator if item not found. Small cstr API change to u8_replace*.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/regex_replace.c | 2 | ||||
| -rw-r--r-- | examples/utf8replace_c.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/regex_replace.c b/examples/regex_replace.c index 2ccbfc3c..8640ced1 100644 --- a/examples/regex_replace.c +++ b/examples/regex_replace.c @@ -36,7 +36,7 @@ int main() /* Shows how to compile RE separately */ c_with (cregex re = cregex_from(pattern, 0), cregex_drop(&re)) { if (cregex_captures(&re) == 0) - c_breakauto; + continue; // break c_with /* European date format. */ cstr_take(&str, cregex_replace(input, &re, "$3.$2.$1", 0)); printf("euros: %s\n", cstr_str(&str)); diff --git a/examples/utf8replace_c.c b/examples/utf8replace_c.c index 1bee9b44..e7659cfd 100644 --- a/examples/utf8replace_c.c +++ b/examples/utf8replace_c.c @@ -8,7 +8,7 @@ int main() { printf("%s\n", cstr_str(&hello)); /* replace second smiley at utf8 codepoint pos 7 */ - cstr_u8_replace_at(&hello, 7, 1, c_sv("🐨")); + cstr_u8_replace(&hello, cstr_find(&hello, "😀rld"), 1, c_sv("🐨")); printf("%s\n", cstr_str(&hello)); |
