File: Fix-invalid-escape-sequences.patch

package info (click to toggle)
gtk-doc 1.34.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,040 kB
  • sloc: python: 9,923; ansic: 915; xml: 889; makefile: 535; sh: 364; lisp: 137; perl: 109
file content (48 lines) | stat: -rw-r--r-- 2,244 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From: Nathan Pratta Teodosio <nathan.teodosio@canonical.com>
Date: Thu, 8 Aug 2024 15:42:33 +0200
Subject: Fix invalid escape sequences

Bug-Debian: https://bugs.debian.org/1077048
Bug-Debian: https://bugs.debian.org/1085626
Forwarded: https://gitlab.gnome.org/GNOME/gtk-doc/-/merge_requests/89
---
 gtkdoc/scan.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index 6b18099..4a660aa 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -41,8 +41,8 @@ import shutil
 from . import common
 
 TYPE_MODIFIERS = ['const', 'signed', 'unsigned', 'long', 'short', 'struct', 'union', 'enum']
-VAR_TYPE_MODIFIER = '(?:' + '|'.join([t + '\s+' for t in TYPE_MODIFIERS]) + ')*'
-RET_TYPE_MODIFIER = '(?:' + '|'.join([t + '\s+' for t in TYPE_MODIFIERS + ['G_CONST_RETURN']]) + ')*'
+VAR_TYPE_MODIFIER = '(?:' + '|'.join([t + r'\s+' for t in TYPE_MODIFIERS]) + ')*'
+RET_TYPE_MODIFIER = '(?:' + '|'.join([t + r'\s+' for t in TYPE_MODIFIERS + ['G_CONST_RETURN']]) + ')*'
 
 # Matchers for current line
 CLINE_MATCHER = [
@@ -235,8 +235,8 @@ def InitScanner(options):
     ignore_decorators = ''
     optional_decorators_regex = ''
     if options.ignore_decorators:
-        ignore_decorators = '|' + options.ignore_decorators.replace('()', '\(\w*\)')
-        optional_decorators_regex = '(?:\s+(?:%s))?' % ignore_decorators[1:]
+        ignore_decorators = '|' + options.ignore_decorators.replace('()', r'\(\w*\)')
+        optional_decorators_regex = r'(?:\s+(?:%s))?' % ignore_decorators[1:]
 
     # FUNCTION POINTER VARIABLES
     CLINE_MATCHER[4] = re.compile(
@@ -484,8 +484,8 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options):
     ignore_decorators = ''          # 1 uses
     optional_decorators_regex = ''  # 4 uses
     if options.ignore_decorators:
-        ignore_decorators = '|' + options.ignore_decorators.replace('()', '\(\w*\)')
-        optional_decorators_regex = '(?:\s+(?:%s))?' % ignore_decorators[1:]
+        ignore_decorators = '|' + options.ignore_decorators.replace('()', r'\(\w*\)')
+        optional_decorators_regex = r'(?:\s+(?:%s))?' % ignore_decorators[1:]
 
     for line in input_lines:
         # If this is a private header, skip it.