File: unescaped-left-brace-in-regex.patch

package info (click to toggle)
nagios-plugin-check-multi 0.26-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,156 kB
  • ctags: 37
  • sloc: perl: 2,296; makefile: 415; sh: 239
file content (28 lines) | stat: -rw-r--r-- 1,124 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
Description: Escape left brace in regex.
 Quoting perldelta:
 "
  A literal "{" should now be escaped in a pattern
 .
  If you want a literal left curly bracket (also called a left brace) in
  a regular expression pattern, you should now escape it by either
  preceding it with a backslash ("\{") or enclosing it within square
  brackets "[{]", or by using \Q; otherwise a deprecation warning will be
  raised. This was first announced as forthcoming in the v5.16 release;
  it will allow future extensions to the language to happen.
 "
 http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
Author: Bas Couwenberg <sebastic@debian.org>
Bug: https://github.com/flackem/check_multi/issues/12
Forwarded: https://github.com/flackem/check_multi/pull/16

--- a/plugins/check_multi.in
+++ b/plugins/check_multi.in
@@ -1227,7 +1227,7 @@ sub parse_objects_cache {
 	}
 	while (<OBJECTS_CACHE>) {
 		#--- begin of object, determine type
-		if (/^define ([a-z0-9\_\-]+) {$/) {
+		if (/^define ([a-z0-9\_\-]+) \{$/) {
 			$type="$1";
 			$typelist{$type}++;
 			$objectcount++;