summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/help2man.diff8
-rwxr-xr-xman/help2man.in41
2 files changed, 13 insertions, 36 deletions
diff --git a/man/help2man.diff b/man/help2man.diff
index 017f4dc5b..12fa76f22 100644
--- a/man/help2man.diff
+++ b/man/help2man.diff
@@ -1,6 +1,6 @@
--- man/help2man-orig
-+++ man/help2man 2013-08-01 02:37:57.771389937 +0200
-@@ -435,6 +435,7 @@
++++ man/help2man 2013-09-10 07:31:28.352365301 +0200
+@@ -412,6 +412,7 @@
my $PAT_FILES = _('Files');
my $PAT_EXAMPLES = _('Examples');
my $PAT_FREE_SOFTWARE = _('This +is +free +software');
@@ -8,7 +8,7 @@
# Start a new paragraph (if required) for these.
s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
-@@ -467,6 +468,12 @@
+@@ -444,6 +445,12 @@
next;
}
@@ -21,7 +21,7 @@
# Copyright section
if (/^Copyright /)
{
-@@ -645,7 +652,7 @@
+@@ -622,7 +629,7 @@
.B %s
programs are properly installed at your site, the command
.IP
diff --git a/man/help2man.in b/man/help2man.in
index 79f686cd7..bfeb98972 100755
--- a/man/help2man.in
+++ b/man/help2man.in
@@ -25,43 +25,22 @@ use strict;
use Getopt::Long;
use Text::Tabs qw(expand);
use POSIX qw(strftime setlocale LC_ALL);
-use Locale::gettext;
-use Encode qw(decode encode);
-use I18N::Langinfo qw(langinfo CODESET);
my $this_program = 'help2man';
my $this_version = '1.43.3';
-my $encoding;
+sub _ { $_[0] }
+sub configure_locale
{
- my $gettext = Locale::gettext->domain($this_program);
- sub _ { $gettext->get($_[0]) }
-
- my ($user_locale) = grep defined && length,
- (map $ENV{$_}, qw(LANGUAGE LC_ALL LC_MESSAGES LANG)), 'C';
-
- my $user_encoding = langinfo CODESET;
-
- # Set localisation of date and executable's output.
- sub configure_locale
- {
- delete @ENV{qw(LANGUAGE LC_MESSAGES LANG)};
- setlocale LC_ALL, $ENV{LC_ALL} = shift || 'C';
- $encoding = langinfo CODESET;
- }
-
- sub dec { $encoding ? decode $encoding, $_[0] : $_[0] }
- sub enc { $encoding ? encode $encoding, $_[0] : $_[0] }
- sub enc_user { encode $user_encoding, $_[0] }
- sub kark # die with message formatted in the invoking user's locale
- {
- setlocale LC_ALL, $user_locale;
- my $fmt = $gettext->get(shift);
- my $errmsg = enc_user sprintf $fmt, @_;
- die $errmsg, "\n";
- }
+ my $locale = shift;
+ die "$this_program: no locale support (Locale::gettext required)\n"
+ unless $locale eq 'C';
}
+sub dec { $_[0] }
+sub enc { $_[0] }
+sub enc_user { $_[0] }
+sub kark { die +(sprintf shift, @_), "\n" }
sub N_ { $_[0] }
sub program_basename;
@@ -142,8 +121,6 @@ my %opt_def = (
Getopt::Long::config('bundling');
die $help_info unless GetOptions %opt_def and @ARGV == 1;
-configure_locale unless $encoding;
-
my %include = ();
my %replace = ();
my %append = ();