File: wikiheaders-Escape-backslash-in-man-pages.patch

package info (click to toggle)
libsdl3 3.2.26%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 42,540 kB
  • sloc: ansic: 390,896; objc: 12,361; xml: 9,084; cpp: 5,729; perl: 4,589; python: 3,372; sh: 1,032; makefile: 265; cs: 56
file content (28 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Simon McVittie <smcv@collabora.com>
Date: Sat, 30 Aug 2025 19:39:24 +0100
Subject: wikiheaders: Escape backslash in man pages

Otherwise, groff will interpret it as a macro, causing the man page
for SDL_GetPrefPath() to be mis-rendered. Escape unescaped backslashes
as `\(rs` ("reverse solidus") before escaping other characters with
macros that, themselves, contain backslashes.

Resolves: https://github.com/libsdl-org/SDL/issues/13039
Signed-off-by: Simon McVittie <smcv@collabora.com>
Forwarded: https://github.com/libsdl-org/SDL/pull/13834
---
 build-scripts/wikiheaders.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index d4205b8..63a8dc9 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -425,6 +425,7 @@ sub dewikify_chunk {
         }
     } elsif ($dewikify_mode eq 'manpage') {
         # make sure these can't become part of roff syntax.
+        $str =~ s/\\/\\(rs/gms;
         $str =~ s/\./\\[char46]/gms;
         $str =~ s/"/\\(dq/gms;
         $str =~ s/'/\\(aq/gms;