summaryrefslogtreecommitdiff
path: root/test/vis/text-objects/indentation.in
diff options
context:
space:
mode:
Diffstat (limited to 'test/vis/text-objects/indentation.in')
-rw-r--r--test/vis/text-objects/indentation.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/vis/text-objects/indentation.in b/test/vis/text-objects/indentation.in
new file mode 100644
index 0000000..8ab6759
--- /dev/null
+++ b/test/vis/text-objects/indentation.in
@@ -0,0 +1,16 @@
+static ssize_t write_all(int fd, const char *buf, size_t count) {
+ size_t rem = count;
+ while (rem > 0) {
+ ssize_t written = write(fd, buf, rem);
+ if (written < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ continue;
+ return -1;
+ } else if (written == 0) {
+ break;
+ }
+ rem -= written;
+ buf += written;
+ }
+ return count - rem;
+}