Skip to contentSkip to conversation

fixupdiff: escape ^ caret

PATCH In review Michael S. Tsirkin 2 participants 3 messages Apr 19, 2022 – Apr 20, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixupdiff: escape ^ caret

Since commit:

commit 1e30753d53d222fbe955f0643583d756105d557e

Author: Jan Kiszka <[email protected]>
Date:   Fri Oct 11 13:43:41 2019 +0200

Fix ^= in example code

Trying to escaping ^ here only leaves the backslash in the output.

we have plain ^ inside listing. Escape it with \ but only if not already escaped (as output of diff with old source will be).

---
 fixupdiff.pl | 4 ++++
 1 file changed, 4 insertions(+)
fixupdiff.pl +4 -0
index f50cf26..e7d3a0f 100644
@@ -35,6 +35,10 @@ while (<>) {
 		$line =~ s/%DIFDELCMD\s+< //;
 		if (not $line =~ m/\\(?:begin|end)\{lstlisting\}/) {
 			$line =~ s/([#&{} ])/\\$1/g;
+			#be careful: do not escape \^
+			$line =~ s/([^\\])(\^)/$1\\$2/g;
+			#also at beginning of line
+			$line =~ s/^(\^)/\\$1/g;
 			if ($add) {
 				$line =~ s/(.*)/\$\\DIFdel\{$1\}\$/;
 			} else {
Signature · 6 lines
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
#1 lore raw
Quoted 13 lines · Michael S. Tsirkin

Since commit:

commit 1e30753d53d222fbe955f0643583d756105d557e

Author: Jan Kiszka <[email protected]>
Date:   Fri Oct 11 13:43:41 2019 +0200

Fix ^= in example code

Trying to escaping ^ here only leaves the backslash in the output.

Quoted 7 lines

we have plain ^ inside listing. Escape it with \ but only if not already escaped (as output of diff with old source will be).

---
 fixupdiff.pl | 4 ++++
 1 file changed, 4 insertions(+)

Thanks, pushed as an editorial update.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#2 lore raw
Quoted 18 lines · Cornelia Huck
Quoted 16 lines · Michael S. Tsirkin

Since commit:

commit 1e30753d53d222fbe955f0643583d756105d557e

Author: Jan Kiszka <[email protected]>
Date:   Fri Oct 11 13:43:41 2019 +0200

Fix ^= in example code

Trying to escaping ^ here only leaves the backslash in the output.

we have plain ^ inside listing. Escape it with \ but only if not already escaped (as output of diff with old source will be).

Quoted 6 lines
Quoted 4 lines
---
 fixupdiff.pl | 4 ++++
 1 file changed, 4 insertions(+)

Thanks, pushed as an editorial update.

Sounds good! OK let me compile this all, upload and we can get the ball rolling with the 1st vote.

Signature · 1 line
MST