From f65ad96d483f3a32a90d4873a98daefa7a1085f2 Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 12 Apr 2000 20:46:18 +0000 Subject: [PATCH] Limited EUC heuristics, should handle bold wide characters correctly, and recognize `NAME' in japanese manpages. --- libexec/makewhatis/makewhatis.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libexec/makewhatis/makewhatis.pl b/libexec/makewhatis/makewhatis.pl index e81c6450622..f040b65d38d 100644 --- a/libexec/makewhatis/makewhatis.pl +++ b/libexec/makewhatis/makewhatis.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # ex:ts=8 sw=4: -# $OpenBSD: makewhatis.pl,v 1.5 2000/04/04 15:31:06 espie Exp $ +# $OpenBSD: makewhatis.pl,v 1.6 2000/04/12 20:46:18 espie Exp $ # # Copyright (c) 2000 Marc Espie. # @@ -223,6 +223,9 @@ sub handle_formated while (<$file>) { next if /^$/; chomp; + # Remove boldface from wide characters + while (s/(..)\cH\cH\1/$1/g) + {} # Remove boldface and underlining while (s/_\cH//g || s/(.)\cH\1/$1/g) {} @@ -234,7 +237,8 @@ sub handle_formated } } # Not all man pages are in english - if (m/^(?:NAME|NAMN|Name)\s*$/) { + # weird hex is `Namae' in japanese + if (m/^(?:NAME|NAMN|Name|\xbe\xcc\xce\xbe)\s*$/) { unless (defined $section) { print STDERR "Can't find section in $filename\n"; $section='??'; -- 2.20.1