about summary refs log tree commit diff
path: root/www/text.causal.agency/colb.c
diff options
context:
space:
mode:
Diffstat (limited to 'www/text.causal.agency/colb.c')
-rw-r--r--www/text.causal.agency/colb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/www/text.causal.agency/colb.c b/www/text.causal.agency/colb.c
new file mode 100644
index 0000000..5faabc3
--- /dev/null
+++ b/www/text.causal.agency/colb.c
@@ -0,0 +1,16 @@
+#include <locale.h>
+#include <stdio.h>
+#include <wchar.h>
+int main(void) {
+	setlocale(LC_CTYPE, "en_US.UTF-8");
+	wint_t next, prev = WEOF;
+	while (WEOF != (next = getwchar())) {
+		if (next == L'\b') {
+			prev = WEOF;
+		} else {
+			if (prev != WEOF) putwchar(prev);
+			prev = next;
+		}
+	}
+	if (prev != WEOF) putwchar(prev);
+}