summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2016-02-16 17:11:35 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2016-02-16 17:11:35 +0000
commit910b3521ddbe18ed8f63c39dfe4d3e88471ee1a1 (patch)
tree6ee64c7ef068bc0350eefa5ba5a87b2bd997e1f9
parentbe7a82cd01062611291a8623ad868885c5523e3e (diff)
fixupdiff: update for latest perl
Escape {} in regexes to avoid warnings in latest perl. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio/branches/v1.0@560 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
-rw-r--r--fixupdiff.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
index 5c82526..e274d00 100644
--- a/fixupdiff.pl
+++ b/fixupdiff.pl
@@ -4,15 +4,15 @@ my $lstlisting=0;
while (<>) {
my $line = $_;
- if (m/%DIFDELCMD\s+<\s+\\begin{lstlisting}/) {
+ if (m/%DIFDELCMD\s+<\s+\\begin\{lstlisting\}/) {
$lstlisting=1;
$line =~s/%DIFDELCMD\s+</{\\lstset{escapechar=\\\$} /;
}
if ($lstlisting) {
$line =~ s/%DIFDELCMD\s+< //;
- if (not $line =~ m/\\(?:begin|end){lstlisting}/) {
+ if (not $line =~ m/\\(?:begin|end)\{lstlisting\}/) {
$line =~ s/([#&{} ])/\\$1/g;
- $line =~ s/(.*)/\$\\DIFdel{$1}\$/;
+ $line =~ s/(.*)/\$\\DIFdel\{$1\}\$/;
}
#print "%FIXED BY RULE 1\n";
}
@@ -26,11 +26,11 @@ while (<>) {
# As a result, number of \color directives goes does sufficiently
# enough to avoid the overflow error.
- s/\\DIFdelbegin \\DIFdel{([^}]*)}\\DIFdelend/\\DIFdeltext{$1}/;
- s/\\DIFaddbegin \\DIFadd{([^}]*)}\\DIFaddend/\\DIFaddtext{$1}/;
+ s/\\DIFdelbegin \\DIFdel\{([^}]*)\}\\DIFdelend/\\DIFdeltext{$1}/;
+ s/\\DIFaddbegin \\DIFadd\{([^}]*)\}\\DIFaddend/\\DIFaddtext{$1}/;
print $line;
- if (m/%DIFDELCMD\s+<\s+\\end{lstlisting}/) {
+ if (m/%DIFDELCMD\s+<\s+\\end\{lstlisting\}/) {
print "}\n";
$lstlisting=0;
}