Skip to content

Commit

Permalink
Merge pull request #347 from bazsi/fix-glib-warning-in-case-multi-lin…
Browse files Browse the repository at this point in the history
…e-regexp-error

Fix glib warning in case multi line regexp error
  • Loading branch information
MrAnno authored Oct 21, 2024
2 parents cc66c5b + 3ba8024 commit 148b7b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/multi-line/multi-line-pattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#include "multi-line/multi-line-pattern.h"
#include "messages.h"

#define MULTI_LINE_PATTERN_ERROR multi_line_pattern_error_quark()

static GQuark
multi_line_pattern_error_quark(void)
{
return g_quark_from_static_string("multi_line_pattern");
}

MultiLinePattern *
multi_line_pattern_compile(const gchar *regexp, GError **error)
{
Expand All @@ -41,7 +49,7 @@ multi_line_pattern_compile(const gchar *regexp, GError **error)
PCRE2_UCHAR error_message[128];

pcre2_get_error_message(rc, error_message, sizeof(error_message));
g_set_error(error, 0, 0,
g_set_error(error, MULTI_LINE_PATTERN_ERROR, 0,
"Error while compiling multi-line regexp as a PCRE expression, error=%s, error_at=%" G_GSIZE_FORMAT,
(gchar *) error_message, erroffset);
goto error;
Expand Down

0 comments on commit 148b7b1

Please sign in to comment.