DS: fix regression in ds_subscribe regex construction

This commit is contained in:
David van Moolenbroek 2011-01-07 17:07:46 +00:00
parent dbcca28c19
commit 410699874c

View File

@ -519,7 +519,7 @@ PUBLIC int do_retrieve_label(const message *m_ptr)
*===========================================================================*/ *===========================================================================*/
PUBLIC int do_subscribe(message *m_ptr) PUBLIC int do_subscribe(message *m_ptr)
{ {
char regex[DS_MAX_KEYLEN+3]; char regex[DS_MAX_KEYLEN+2];
struct subscription *subp; struct subscription *subp;
char errbuf[80]; char errbuf[80];
char *owner; char *owner;
@ -546,9 +546,8 @@ PUBLIC int do_subscribe(message *m_ptr)
* and the usual case is for a complete match. * and the usual case is for a complete match.
*/ */
regex[0] = '^'; regex[0] = '^';
if((r = get_key_name(m_ptr, regex)) != OK) if((r = get_key_name(m_ptr, regex+1)) != OK)
return r; return r;
regex[DS_MAX_KEYLEN-1] = '\0';
strcat(regex, "$"); strcat(regex, "$");
/* Compile regular expression. */ /* Compile regular expression. */