aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-31 14:10:24 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-31 14:10:24 +0100
commitdfb4fd31240a7f19428da1b5978ddfc355c0c68c (patch)
tree0c203e2cbb294007eb44d750bb060054b3c1aaf7 /sam.c
parente6761ecfdf9f7a83c8f5db433b2ab0f9d579cdd5 (diff)
downloadvis-dfb4fd31240a7f19428da1b5978ddfc355c0c68c.tar.gz
vis-dfb4fd31240a7f19428da1b5978ddfc355c0c68c.tar.xz
sam: use buffer_move where appropriate
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sam.c b/sam.c
index a86cf35..6aedf70 100644
--- a/sam.c
+++ b/sam.c
@@ -478,7 +478,7 @@ static char *parse_until(const char **s, const char *until, const char *escchars
if (buffer_length(&buf))
buffer_append(&buf, "\0", 1);
- return buf.data;
+ return buffer_move(&buf);
}
static char *parse_delimited(const char **s, int type) {
@@ -511,7 +511,7 @@ static char *parse_text(const char **s) {
return NULL;
}
- return buf.data;
+ return buffer_move(&buf);
}
static char *parse_shellcmd(Vis *vis, const char **s) {
@@ -546,7 +546,7 @@ static char *parse_cmdname(const char **s) {
if (buffer_length(&buf))
buffer_append(&buf, "\0", 1);
- return buf.data;
+ return buffer_move(&buf);
}
static Regex *parse_regex(Vis *vis, const char **s) {
@@ -1282,7 +1282,7 @@ static bool cmd_substitute(Vis *vis, Win *win, Command *cmd, const char *argv[],
buffer_init(&buf);
bool ret = false;
if (buffer_put0(&buf, "s") && buffer_append0(&buf, argv[1]))
- ret = cmd_filter(vis, win, cmd, (const char*[]){ argv[0], "sed", buf.data, NULL }, cur, range);
+ ret = cmd_filter(vis, win, cmd, (const char*[]){ argv[0], "sed", buffer_move(&buf), NULL }, cur, range);
buffer_release(&buf);
return ret;
}