summaryrefslogtreecommitdiff
path: root/src/core/wee-string.c
AgeCommit message (Collapse)Author
2023-06-27core: check for newline characters in string_is_whitespace_charTrygve Aaberge
This fixes a bug where if you had multiple lines in the input and pressed ctrl-w when the cursor was after the first word of any line but the first, it would delete both the word before the cursor and the last word on the preceding line.
2023-05-05core: fix execution of multiple commands separated by newline when there are ↵Sébastien Helleu
no spaces For example typing this on core buffer: /t1 /t2 was not executing the two commands but sent the text to the buffer instead. This is because WeeChat thinks it's a path, and the newline should indicate it's not (like a space before the next slash: "/t1 /t2" is a command, not a path, but "/t1/t2" is considered a path).
2023-01-30core: add function string_get_common_bytes_count (issue #1877)Sébastien Helleu
2023-01-30core: add function string_levenshtein (issue #1877)Sébastien Helleu
2023-01-29api: readjust string size in function string_dyn_free when string is not ↵Sébastien Helleu
freed (issue #1875) This frees some allocated memory if size_alloc was greater than size in the dynamic string.
2023-01-28core: move function hook_get_priority_and_name to wee-string.c (issue #1872)Sébastien Helleu
2023-01-01core: update copyright datesSébastien Helleu
2022-12-24api: add functions string_strcmp and string_strncmpSébastien Helleu
2022-12-24doc/api: mention "UTF-8" in char/string comparison functionsSébastien Helleu
2022-12-24api: rename char comparison functions "utf8_char*" to "string_char*"Sébastien Helleu
2022-12-24api: return arithmetic difference between chars in string comparison functionsSébastien Helleu
Return code is changed for the following functions: - string_strcasecmp - string_strcasecmp_range - string_strncasecmp - string_strncasecmp_range - string_strcmp_ignore_chars - utf8_charcmp - utf8_charcasecmp - utf8_charcasecmp_range
2022-12-23api: fix function strcmp_ignore_chars with case sensitive comparison and ↵Sébastien Helleu
wide chars starting with the same byte
2022-12-21core: improve case convert and insensitive char comparisons (closes #258)Sébastien Helleu
All lowercase letters are now properly converted to uppercase letters (and vice versa), via functions `towupper` and `towlower`. Functions `string_tolower`, `string_toupper` and `utf8_charcasecmp` have been optimized to be faster when there are ASCII chars (< 128); functions are about 25-40% faster with mixed chars (both ASCII and multi-bytes). Function `utf8_wide_char` has been removed, `utf8_char_int` can be used instead.
2022-12-19core: return directly output of string_dyn_free without temporary variableSébastien Helleu
2022-12-18api: return newly allocated string in functions string_tolower and ↵Sébastien Helleu
string_toupper
2022-12-18core: return number of bytes for UTF-8 char in function utf8_int_stringSébastien Helleu
2022-12-10core: fix function string_cut when there are non printable chars in suffixSébastien Helleu
2022-11-05api: add function string_translate_charsSébastien Helleu
2022-10-08core: fix compilation warning on isdigit functionSébastien Helleu
2022-09-27api: restrict number to integer in function string_parse_sizeSébastien Helleu
2022-09-27api: add function string_parse_sizeSébastien Helleu
2022-09-18core: add key alt+backspace, change behavior of key ctrl+w (closes #559)Sébastien Helleu
The key ctrl+w now deletes one word until whitespace. The new key alt+backspace deletes one word (same behavior as ctrl+w in previous releases).
2022-07-20api: add arguments "index_start" and "index_end" in function ↵Sébastien Helleu
string_rebuild_split_string
2022-07-20api: rename function string_build_with_split_string to ↵Sébastien Helleu
string_rebuild_split_string
2022-02-19core: call strdup in string_strndup if bytes equals strlen of stringSébastien Helleu
2022-01-17core: update copyright datesSébastien Helleu
2022-01-14core: rename argument "length" to "bytes" in function string_strndupSébastien Helleu
2021-07-04typing: add typing pluginSébastien Helleu
2021-06-22core: fix function string_match with joker in the string if multiple words ↵Sébastien Helleu
matched in input string Before fix: string_match("script.color.text_description", "*script*color*", 0) => 0 After fix: string_match("script.color.text_description", "*script*color*", 0) => 1
2021-05-29core, irc, script: fix typosSébastien Helleu
2021-05-11doc: add XDG directories support in docs (issue #1285)Sébastien Helleu
2021-05-11core: split WeeChat home in 4 directories, use XDG directories by default ↵Sébastien Helleu
(issue #1285) The 4 directories (which can be the same): - config: configuration files, certificates - data: log/upgrade files, local plugins, scripts, xfer files - cache: script repository, scripts downloaded (temporary location) - runtime: FIFO pipe, relay UNIX sockets
2021-01-02core: update copyright datesSébastien Helleu
2021-01-01doc: add note about call to "regfree" after call to "string_regcomp" (plugin ↵Sébastien Helleu
API reference)
2020-08-23api: add argument "bytes" in function string_dyn_concatSébastien Helleu
2020-05-21core: move functions string_base_encode and string_base_decode from ↵Sébastien Helleu
plugin-api.c to wee-string.c
2020-05-21core: return -1 in case of error in functions string_base16_decode and ↵Sébastien Helleu
string_base64_decode
2020-03-01core: move crypto functions to wee-crypto.c, rename API function string_hash ↵Sébastien Helleu
to crypto_hash
2020-03-01core: merge functions string_hash_binary and string_hash into a single ↵Sébastien Helleu
function string_hash
2020-02-29core: add support of CRC32 algorithm in hash functionsSébastien Helleu
2020-02-29api: add functions string_hash_binary and string_hashSébastien Helleu
2020-01-04core: update copyright datesSébastien Helleu
2019-10-12core: add reverse of string for screen in evaluation of expressions with ↵Sébastien Helleu
"revscr:"
2019-09-17Fixed segfault during excessive evaluation.Tobias Stoeckmann
It is possible to trigger a segmentation fault while processing an evaluation of repeating string. On a Linux 64 bit system, enter this (or adjust arguments for 32 bit accordingly): /eval -n ${repeat:1073741824,----} It will overflow an integer calculation because int instead of size_t is used. Proper check of int limitations fixes this issue. I haven't changed this specific piece of code to size_t because it would crash in other parts of the code tree instead. For now, int is a limitating factor when it comes to strings (and should be enough for sane use cases). Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-06-15api: add argument "strip_items" in function string_splitSébastien Helleu
2019-06-15core: check that string pointer is not NULL in function "string_shared_get"Sébastien Helleu
2019-03-17core: fix typo: Weechat -> WeeChatSébastien Helleu
2019-03-10core: replace argument "keep_eol" by "flags" in function string_split ↵Sébastien Helleu
(closes #1322)
2019-03-09core: add value -1 for keep_eol in function string_strip (issue #1322)Sébastien Helleu
The value -1 means it's a standard split, but empty items are kept, and separators are not removed at beginning/end of string.
2019-02-27api: add function string_match_listSébastien Helleu