aboutsummaryrefslogtreecommitdiff
path: root/ssh/string_view.c
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-13 19:26:17 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-13 19:26:17 +0200
commitb5f5fdefbbee3ae75bb032774263885c46d63a7f (patch)
tree8f72ed418e68572abe31a80517df2af623135c7a /ssh/string_view.c
parent3fafd0ccefa286fa1b8c3e53e9e835a84d8c9861 (diff)
ssh/client: More ergonomic interface with / commands and focusing
Diffstat (limited to 'ssh/string_view.c')
-rw-r--r--ssh/string_view.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ssh/string_view.c b/ssh/string_view.c
index 2f4f22a..ba05236 100644
--- a/ssh/string_view.c
+++ b/ssh/string_view.c
@@ -70,3 +70,10 @@ void sv_skip_whitespace(struct string_view *line) {
line->len--;
}
}
+
+void sv_skip(struct string_view *line, size_t num) {
+ if (!line->s) return;
+ if (num > line->len) num = line->len;
+ line->s += num;
+ line->len -= num;
+}