summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2015-05-21 10:13:40 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2015-05-21 10:13:40 +0000
commit601882e8907263e0d16cafd934ade9fe6e20f80f (patch)
tree9937da81729c5b3f87533b320f7b3f7373dc99b8
parente06b2ff405259b3d4a8f49ec83e4ae69f84f75f6 (diff)
fixupdiff: better diff for lstlisting
Actually strike out deleted text. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio/branches/v1.0@535 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
-rw-r--r--fixupdiff.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
index 94c5112..e557e2b 100644
--- a/fixupdiff.pl
+++ b/fixupdiff.pl
@@ -1,14 +1,18 @@
my $bufferdiff="";
my $diff="";
my $buffer="";
-my $lstlisting=0;
while (<>) {
my $line = $_;
if (m/%DIFDELCMD\s+<\s+\\begin{lstlisting}/) {
$lstlisting=1;
+ $line =~s/%DIFDELCMD\s+</{\\lstset{escapechar=\\\$} /;
}
if ($lstlisting) {
- $line =~ s/%DIFDELCMD\s+<\s+//;
+ $line =~ s/%DIFDELCMD\s+< //;
+ if (not $line =~ m/\\(?:begin|end){lstlisting}/) {
+ $line =~ s/([#&{} ])/\\$1/g;
+ $line =~ s/(.*)/\$\\DIFdel{$1}\$/;
+ }
#print "%FIXED BY RULE 1\n";
}
#In section headings, replace begin/end with begin/endFL,
@@ -67,6 +71,7 @@ while (<>) {
}
print $line;
if (m/%DIFDELCMD\s+<\s+\\end{lstlisting}/) {
+ print "}\n";
$lstlisting=0;
}
}