From b9f4b342ae5b91316c98f9c36901863079c5b085 Mon Sep 17 00:00:00 2001 From: zhuk Date: Fri, 23 Oct 2015 11:01:30 +0000 Subject: [PATCH] Fix BODUN handling after switch to UTF-8. Still wondering if this functionality should be removed, but I'll leave the decision to those who drink alcohol. Input from & okay tedu@. --- usr.bin/calendar/calendar.1 | 8 ++++---- usr.bin/calendar/io.c | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.bin/calendar/calendar.1 b/usr.bin/calendar/calendar.1 index acaf0f7dbc2..f0a9596c797 100644 --- a/usr.bin/calendar/calendar.1 +++ b/usr.bin/calendar/calendar.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: calendar.1,v 1.38 2015/09/25 16:36:00 schwarze Exp $ +.\" $OpenBSD: calendar.1,v 1.39 2015/10/23 11:01:30 zhuk Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)calendar.1 8.1 (Berkeley) 6/29/93 .\" -.Dd $Mdocdate: September 25 2015 $ +.Dd $Mdocdate: October 23 2015 $ .Dt CALENDAR 1 .Os .Sh NAME @@ -70,7 +70,7 @@ Print lines from today and previous .Ar num days (backward, past). .It Fl b -Enforce special date calculation mode for KOI8 calendars. +Enforce special date calculation mode for Cyrillic calendars. .It Fl f Ar calendarfile Use .Ar calendarfile @@ -110,7 +110,7 @@ you should specify .Dq LANG= and .Dq BODUN= -where can be ru_RU.KOI8-R, uk_UA.KOI8-U or by_BY.KOI8-B. +where can be ru_RU.UTF-8, uk_UA.UTF-8 or by_BY.UTF-8. .Pp Other lines should begin with a month and day. They may be entered in almost any format, either numeric or as character diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 1e1950b2d30..7e4b3719745 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.39 2015/04/18 18:28:37 deraadt Exp $ */ +/* $OpenBSD: io.c,v 1.40 2015/10/23 11:01:30 zhuk Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -89,7 +89,11 @@ cal(void) if (strncmp(buf, "LANG=", 5) == 0) { (void) setlocale(LC_ALL, buf + 5); setnnames(); - if (!strcmp(buf + 5, "ru_RU.KOI8-R") || + /* XXX remove KOI8 lines after 5.9 is out */ + if (!strcmp(buf + 5, "ru_RU.UTF-8") || + !strcmp(buf + 5, "uk_UA.UTF-8") || + !strcmp(buf + 5, "by_BY.UTF-8")) || + !strcmp(buf + 5, "ru_RU.KOI8-R") || !strcmp(buf + 5, "uk_UA.KOI8-U") || !strcmp(buf + 5, "by_BY.KOI8-B")) { bodun_maybe++; -- 2.20.1