From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:56 +0000 (-0700) Subject: Dump gErr on regex failures X-Git-Tag: stable-10.2.0~603 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ca9fd8b08aec527c83941909015f846bbae634a;p=thirdparty%2Fopen-vm-tools.git Dump gErr on regex failures With pcre moving outside glib, there are new errors, such as pcre not being built with UTF-8 support, that can be caught here. --- diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c index 54b02398a..56ee94ffb 100644 --- a/open-vm-tools/services/plugins/vix/vixTools.c +++ b/open-vm-tools/services/plugins/vix/vixTools.c @@ -6255,7 +6255,7 @@ VixToolsListFiles(VixCommandRequestHeader *requestMsg, // IN int remaining = 0; int numResults; GRegex *regex = NULL; - GError *gerr = NULL; + GError *gErr = NULL; char *pathName; VMAutomationRequestParser parser; @@ -6309,10 +6309,11 @@ VixToolsListFiles(VixCommandRequestHeader *requestMsg, // IN index, maxResults, (int) offset); if (pattern) { - regex = g_regex_new(pattern, 0, 0, &gerr); + regex = g_regex_new(pattern, 0, 0, &gErr); if (!regex) { - g_warning("%s: bad regex pattern '%s'; failing with INVALID_ARG\n", - __FUNCTION__, pattern); + g_warning("%s: bad regex pattern '%s' (%s);" + "failing with INVALID_ARG\n", + __FUNCTION__, pattern, gErr ? gErr->message : ""); err = VIX_E_INVALID_ARG; goto abort; }