diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-31 14:30:00 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-31 14:30:00 +0800 |
commit | a1ed6eaec440ad25f08a4752809d49ddcd4f4da3 (patch) | |
tree | 79f063842695cf51840d633d756eb3078c6e205f /utils | |
parent | Replace FileContributor with FileCopyrightText (diff) | |
download | forge-a1ed6eaec440ad25f08a4752809d49ddcd4f4da3.tar.gz forge-a1ed6eaec440ad25f08a4752809d49ddcd4f4da3.tar.zst forge-a1ed6eaec440ad25f08a4752809d49ddcd4f4da3.zip |
Use FreeBSD kernel normal form for C source
Diffstat (limited to 'utils')
-rw-r--r-- | utils/colb.c | 16 |
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; } } |