diff options
Diffstat (limited to '')
-rw-r--r-- | www/text.causal.agency/colb.c | 16 |
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 00000000..5faabc3a --- /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); +} |