From 875659f4921392e55e8e1ba0e3dd1678a058fe8a Mon Sep 17 00:00:00 2001 From: Bill Torpey Date: Thu, 19 Oct 2023 07:46:14 -0400 Subject: [PATCH] [BUS-2289] - revert 08ee0376c94726b7eb2087a9c9573a6b909a8561 --- src/subscription.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/subscription.c b/src/subscription.c index 1f5bf93..2fd6e68 100755 --- a/src/subscription.c +++ b/src/subscription.c @@ -113,10 +113,16 @@ mama_status zmqBridgeMamaSubscription_createWildCard(subscriptionBridge* subscri if (prefix[0] == '^') { ++prefix; // skip beginning anchor } - char* regexPos = strpbrk(prefix, "[^/]+.*"); // find wildcard regex? + char* regexPos = strstr(prefix, "[^/]+"); // find wildcard regex? if (regexPos != NULL) { *regexPos = '\0'; // overwrite with null } + else { + int l = strlen(prefix); + if (strcmp(&prefix[l-3], "/.*") == 0) { // find trailing "super" wildcard? + prefix[l-2] = '\0'; // overwrite with null + } + } MAMA_LOG(MAMA_LOG_LEVEL_FINE, "source=%s,prefix=%s", source, prefix); // create regex to match against