/[perl]/rcs2html.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /rcs2html.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Sun Oct 26 14:24:32 2003 UTC revision 1.2 by dpavlin, Sat Jan 31 18:50:31 2004 UTC
# Line 5  use strict; Line 5  use strict;
5  my $rcs2log = "rcs2log ".join(" ",@ARGV);  my $rcs2log = "rcs2log ".join(" ",@ARGV);
6  my $have_ul = 0;  my $have_ul = 0;
7    
8    sub encode {
9            my $foo = shift;
10            $foo =~ s/</&lt;/g;
11            $foo =~ s/>/&gt;/g;
12            $foo =~ s/"/&quot;/g;
13            return $foo;
14    }
15            
16    
17  open(RCS2LOG, "$rcs2log |") || die "$rcs2log: $!";  open(RCS2LOG, "$rcs2log |") || die "$rcs2log: $!";
18  while(<RCS2LOG>) {  while(<RCS2LOG>) {
19          chomp;          chomp;
# Line 15  while(<RCS2LOG>) { Line 24  while(<RCS2LOG>) {
24                          print "</ul>\n";                          print "</ul>\n";
25                          $have_ul = 0;                          $have_ul = 0;
26                  }                  }
27                  $email =~ s/</&lt;/g;                  $email = encode($email);
                 $email =~ s/>/&gt;/g;  
28                  $email =~ s/@/(at)/g;                  $email =~ s/@/(at)/g;
29                  $email =~ s/\./(dot)/g;                  $email =~ s/\./(dot)/g;
30                  print "<tt>$date</tt> $who <tt>$email</tt>\n";                  print "<tt>$date</tt> $who <tt>$email</tt>\n";
# Line 25  while(<RCS2LOG>) { Line 33  while(<RCS2LOG>) {
33                          print "<ul>\n";                          print "<ul>\n";
34                          $have_ul = 1;                          $have_ul = 1;
35                  }                  }
36                  print "<li> <tt>$1</tt>:$2\n";                  print "<li> <tt>$1</tt>:".encode($2)."\n";
37          } elsif (/^\t([-]\s.*)$/) {          } elsif (/^\t([-]\s.*)$/) {
38                  print "<br>$1\n";                  print "<br>".encode($1)."\n";
39          } else {          } else {
40                  print "$_\n";                  print encode($_)."\n";
41          }          }
42  }  }
43    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26