aboutsummaryrefslogtreecommitdiff
path: root/utils/colb.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/colb.c')
-rw-r--r--utils/colb.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/utils/colb.c b/utils/colb.c
index e50ac5d..79ed06d 100644
--- a/utils/colb.c
+++ b/utils/colb.c
@@ -1,19 +1,25 @@
-// SPDX-License-Identifier: GPL-3.0-only
-// SPDX-FileCopyrightText: Copyright (c) 2021 June McEnroe <june@causal.agency>
+/*-
+ * SPDX-License-Identifier: GPL-3.0-only
+ * SPDX-FileCopyrightText: Copyright (c) 2021 June McEnroe <june@causal.agency>
+ */
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
-int main(void)
+int
+main(void)
{
+ wint_t next, prev = WEOF;
+
setlocale(LC_CTYPE, "C.UTF-8");
- wint_t next, prev = WEOF;
+
while (WEOF != (next = getwchar())) {
if (next == L'\b') {
prev = WEOF;
} else {
- if (prev != WEOF) putwchar(prev);
+ if (prev != WEOF)
+ putwchar(prev);
prev = next;
}
}