diff options
author | Daniel Carl <danielcarl@gmx.de> | 2014-07-31 01:16:38 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2014-07-31 01:16:38 +0200 |
commit | 92413f9aa0097150c74b00f5690fd5d7b74c53de (patch) | |
tree | 6823b046a0b705825afb718790b48a3cf0817d98 /src/util.c | |
parent | 555458c31ff9d6bb6232513dd5229b94e9158b90 (diff) |
Implemented extended :set syntax.
Added the new :set flavours :set option+=..., :set option-=..., set
option^=... like in vim.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -251,15 +251,15 @@ next: /** * Replaces appearances of search in string by given replace. - * Returne a new allocated string of search was found. + * Returne a new allocated string if search was found. */ -char *util_str_replace(const char* search, const char* replace, const char* string) +char *util_str_replace(const char* search, const char* replace, const char* string, int max_replaces) { if (!string) { return NULL; } - char **buf = g_strsplit(string, search, -1); + char **buf = g_strsplit(string, search, max_replaces + 1); char *ret = g_strjoinv(replace, buf); g_strfreev(buf); |