diff options
| -rw-r--r-- | RELEASE_NOTES.md | 2 | ||||
| -rw-r--r-- | rss.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7e5b722..174b873 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | ## UNRELEASED | 3 | ## UNRELEASED |
| 4 | 4 | ||
| 5 | Truncate RSS titles at UTF-8 character boundaries (contributed by lxo). | ||
| 6 | |||
| 5 | Link contacts to single-user people pages. Also, user's posts are shown (contributed by lxo). | 7 | Link contacts to single-user people pages. Also, user's posts are shown (contributed by lxo). |
| 6 | 8 | ||
| 7 | Added emoji reactions (contributed by violette). | 9 | Added emoji reactions (contributed by violette). |
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "xs_openssl.h" | 10 | #include "xs_openssl.h" |
| 11 | #include "xs_json.h" | 11 | #include "xs_json.h" |
| 12 | #include "xs_http.h" | 12 | #include "xs_http.h" |
| 13 | #include "xs_unicode.h" | ||
| 13 | 14 | ||
| 14 | #include "snac.h" | 15 | #include "snac.h" |
| 15 | 16 | ||
| @@ -74,7 +75,14 @@ xs_str *rss_from_timeline(snac *user, const xs_list *timeline, | |||
| 74 | title = xs_regex_replace_i(title, "&[^;]+;", " "); | 75 | title = xs_regex_replace_i(title, "&[^;]+;", " "); |
| 75 | int i; | 76 | int i; |
| 76 | 77 | ||
| 77 | for (i = 0; title[i] && title[i] != '\n' && i < 50; i++); | 78 | for (i = 0; title[i] && title[i] != '\n' && i < 50; ) { |
| 79 | const char *p = &title[i]; | ||
| 80 | unsigned int cp = xs_utf8_dec(&p); | ||
| 81 | int n = p - title; | ||
| 82 | if (cp == 0xfffd || n > 50) | ||
| 83 | break; | ||
| 84 | i = n; | ||
| 85 | } | ||
| 78 | 86 | ||
| 79 | if (title[i] != '\0') { | 87 | if (title[i] != '\0') { |
| 80 | title[i] = '\0'; | 88 | title[i] = '\0'; |