diff --git a/src/ChangeLog b/src/ChangeLog index e9e767194..ac99ddd6d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2002-03-20 Andrew V. Samoilov + * man2hlp.c (handle_command): Handle '.\"TOPICS' comment. + Use it for translated 'Topics:' message. + * gindex.pl: Use first line of man2hlp output as + translated 'Topics:' message if fourth argument + is empty string. + * Makefile.am (mc.hlp.ru): Use empty string as gindex.pl's + fourth argument. + * textconf.c (version): Write to stdout. * main.c (print_mc_usage): Add "stream" parameter to specify file stream. diff --git a/src/Makefile.am b/src/Makefile.am index 8deb9b71a..b9e8d84b2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -75,7 +75,7 @@ $(srcdir)/mc.hlp: $(top_srcdir)/doc/mc.1 $(top_srcdir)/lib/xnc.hlp $(srcdir)/gin $(srcdir)/mc.hlp.ru: $(top_srcdir)/doc/ru/mc.1 $(top_srcdir)/doc/ru/xnc.hlp $(srcdir)/gindex.pl man2hlp - perl $(srcdir)/gindex.pl $(top_srcdir)/doc/ru/mc.1 \ - $(top_srcdir)/doc/ru/xnc.hlp $(srcdir)/mc.hlp.ru 'Разделы помощи:' + $(top_srcdir)/doc/ru/xnc.hlp $(srcdir)/mc.hlp.ru '' install-exec-hook: $(MAKE) install_mcview diff --git a/src/gindex.pl b/src/gindex.pl index 6cad4ccca..1bb4edbc3 100755 --- a/src/gindex.pl +++ b/src/gindex.pl @@ -26,6 +26,11 @@ open (HELP2, "< $tmpl_file") or die "Cannot open $tmpl_file: $!\n"; push @help_file, ; close (HELP2); +if ($Topics eq ''){ + $Topics = shift (@help_file); + chomp ($Topics); +} + foreach $line (@help_file){ if ($line =~ /\x04\[(.*)\]/ && $line !~ /\x04\[main\]/){ if (length $1) { diff --git a/src/man2hlp.c b/src/man2hlp.c index 39abbc075..e550e92a0 100644 --- a/src/man2hlp.c +++ b/src/man2hlp.c @@ -267,6 +267,18 @@ static void handle_command (char *buffer) if (col > 0) newline (); newline (); } + else if (strcmp (buffer, ".\\\"TOPICS") == 0){ + if (out_row > 1){ + print_error ("Syntax error: .\\\"TOPICS must be first command"); + return; + } + buffer = strtok (NULL, ""); + if (buffer == NULL){ + print_error ("Syntax error: .\\\"TOPICS: no text"); + return; + } + printf ("%s\n", buffer); + } else { /* Other commands are ignored */ }