summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-04-12 20:46:19 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-04-12 20:46:19 +0000
commite2ce5f8ca32d5fd59097b9068f6fe1f51d229da6 (patch)
tree05c73aab36db1b98efc2e0e9da286cd85db81d74 /libexec
parentd92a593e18dd9059999f53ce8192b5272fc6301d (diff)
Limited EUC heuristics, should handle bold wide characters correctly,
and recognize `NAME' in japanese manpages.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/makewhatis/makewhatis.pl8
1 files 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='??';