Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down