Fixed most of the warnings present when processing docs with -w enabled.

* perl5lib/LinuxDocTools.pm:
  - Value of <HANDLE> construct can be "0"; test with defined() at ../perl5lib/LinuxDocTools.pm line 140.
    + Use defined ($dtd2 = <$TMP>)
  - Subroutine process_options redefined at ../perl5lib/LinuxDocTools.pm line 362.
    + Utils::process_options is always used with fulll name. No need to import it.
  - Use of uninitialized value in concatenation (.) or string at ../perl5lib/LinuxDocTools.pm line 419.
    + /etc/sgml.catalog had bad (unneeded) prefix.
* lib/fmt/fmt_lyx.pl:
  - Use of uninitialized value in numeric eq (==) at /tmp/ldt.OGoYc31777/linuxdoc-tools/fmt/fmt_lyx.pl line 222, ...
    Make sure $inlookchange is initialized.
* lib/fmt/fmt_rtf.pl:
  - Use of uninitialized value in concatenation (.) or string at /tmp/ldt.OGoYc31777/linuxdoc-tools/fmt/fmt_rtf.pl line 53.
    + Better check
* lib/fmt/fmt_txt.pl:
  - "my" variable $number masks earlier declaration in same scope at /tmp/ldt.OGoYc31777/linuxdoc-tools/fmt/fmt_txt.pl line 266.
    + Remove redundant my.

* doc/Makedoc.sh: print next backend to be used.
parent 5a758994
......@@ -42,15 +42,18 @@ chmod u+x $TMPDIR/linuxdoc
if [ -n "`which groff`" ]; then
ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
echo "- Building txt docs" >&2
$TMPDIR/sgml2txt -b 1 ./guide
fi
if [ -n "`which latex`" ]; then
ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
echo "- Building latex docs" >&2
$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
fi
if [ -n "`which dvips`" ]; then
echo " + dvips" >&2
dvips -t letter -o ./guide.ps ./guide.dvi
if [ -n "`which gzip`" -a -f ./guide.ps ]; then
gzip -fN ./guide.ps
......@@ -58,11 +61,16 @@ if [ -n "`which dvips`" ]; then
fi
echo "- Building info docs" >&2
$TMPDIR/linuxdoc -B info ./guide.sgml
echo "- Building lyx docs" >&2
$TMPDIR/linuxdoc -B lyx ./guide.sgml
echo "- Building html docs" >&2
$TMPDIR/linuxdoc -I -B html ./guide && mv -f ./guide*.html ./html
echo "- Building rtf docs" >&2
$TMPDIR/linuxdoc -B rtf ./guide && if [ ! -d ./rtf ]; \
then mkdir -m 755 ./rtf; fi && mv -f ./guide*.rtf ./rtf
......
......@@ -102,7 +102,7 @@ $lyx->{postASP} = sub {
my $indent_level = -1;
my $verb_last_line = "";
my $verbatim = 0;
my $inlookchange;
my $inlookchange = 0;
my $inheading;
my $initem;
my $intag;
......
......@@ -46,7 +46,7 @@ $rtf->{postASP} = sub {
my $INFILE = shift;
my $PIPE;
my $rtf2rtf = "$main::AuxBinDir/rtf2rtf";
my $split = "-2" if $rtf->{twosplit};
my $split = ($rtf->{twosplit}) ? "-2" : "";
my $prefile = "$global->{filename}";
my $rtffile = "$global->{filename}.rtf";
......
......@@ -263,7 +263,7 @@ $txt->{preASP} = sub
$header[$level]++;
}
my $number = join ('.',@header);
$number = join ('.',@header);
if ( ! $#header ) {
# put a . after top level sections
......
......@@ -44,7 +44,7 @@ use File::Copy;
use File::Temp qw(tempdir);
use File::Basename qw(fileparse);
use LinuxDocTools::Lang;
use LinuxDocTools::Utils qw(process_options usage cleanup trap_signals remove_tmpfiles create_temp);
use LinuxDocTools::Utils qw(usage cleanup trap_signals remove_tmpfiles create_temp);
use LinuxDocTools::Vars;
sub BEGIN
......@@ -137,7 +137,7 @@ sub ldt_getdtd_v2 {
open (my $TMP,"< $preaspout")
or die "%error_header: Could not open $preaspout for reading. Aborting ...\n";
while ( ($dtd2 = <$TMP>) && ! ( $dtd2 =~ /^\(/) ) { };
while ( defined ($dtd2 = <$TMP>) && ! ( $dtd2 =~ /^\(/) ) { };
close $TMP;
$dtd2 =~ s/^\(//;
$dtd2 =~ tr/A-Z/a-z/;
......@@ -419,7 +419,7 @@ sub process_options {
my @sgmlcatalogs = ( "$main::prefix/share/sgml/entities/sgml-iso-entities-8879.1986/catalog",
"$main::prefix/share/sgml/iso-entities-8879.1986/iso-entities.cat",
"$main::DataDir/linuxdoc-tools.catalog",
"$main::/etc/sgml.catalog");
"/etc/sgml.catalog");
@sgmlcatalogs = ($ENV{SGML_CATALOG_FILES}, @sgmlcatalogs) if defined $ENV{SGML_CATALOG_FILES};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment