diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:19 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:19 -0800 |
commit | 48e1144df43616c7672ed98ed9da40a50622c18b (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /format.pl | |
parent | d78fa13a44d08622d61d0df71e731de77021dcf1 (diff) | |
download | bzip2-48e1144df43616c7672ed98ed9da40a50622c18b.tar.gz |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'format.pl')
-rwxr-xr-x | format.pl | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/format.pl b/format.pl deleted file mode 100755 index 1928d15..0000000 --- a/format.pl +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -w -# -# ------------------------------------------------------------------ -# This file is part of bzip2/libbzip2, a program and library for -# lossless, block-sorting data compression. -# -# bzip2/libbzip2 version 1.0.5 of 10 December 2007 -# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org> -# -# Please read the WARNING, DISCLAIMER and PATENTS sections in the -# README file. -# -# This program is released under the terms of the license contained -# in the file LICENSE. -# ------------------------------------------------------------------ -# -use strict; - -# get command line values: -if ( $#ARGV !=1 ) { - die "Usage: $0 xml_infile xml_outfile\n"; -} - -my $infile = shift; -# check infile exists -die "Can't find file \"$infile\"" - unless -f $infile; -# check we can read infile -if (! -r $infile) { - die "Can't read input $infile\n"; -} -# check we can open infile -open( INFILE,"<$infile" ) or - die "Can't input $infile $!"; - -#my $outfile = 'fmt-manual.xml'; -my $outfile = shift; -#print "Infile: $infile, Outfile: $outfile\n"; -# check we can write to outfile -open( OUTFILE,">$outfile" ) or - die "Can't output $outfile $! for writing"; - -my ($prev, $curr, $str); -$prev = ''; $curr = ''; -while ( <INFILE> ) { - - print OUTFILE $prev; - $prev = $curr; - $curr = $_; - $str = ''; - - if ( $prev =~ /<programlisting>$|<screen>$/ ) { - chomp $prev; - $curr = join( '', $prev, "<![CDATA[", $curr ); - $prev = ''; - next; - } - elsif ( $curr =~ /<\/programlisting>|<\/screen>/ ) { - chomp $prev; - $curr = join( '', $prev, "]]>", $curr ); - $prev = ''; - next; - } -} -print OUTFILE $curr; -close INFILE; -close OUTFILE; -exit; |