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