diff --git a/src/StreamCore.cc b/src/StreamCore.cc index 0515dd6..f8b4408 100644 --- a/src/StreamCore.cc +++ b/src/StreamCore.cc @@ -187,9 +187,12 @@ bool StreamCore:: parse(const char* filename, const char* _protocolname) { protocolname = _protocolname; - // extract substitutions from protocolname "name(sub1,sub2)" + // extract substitutions from protocolname "name ( sub1, sub2 ) " ssize_t i = protocolname.find('('); - if (i >= 0) + if (i < 0) i = 0; + while (protocolname[i-1] == ' ') + protocolname.remove(--i, 1); + if (protocolname[i] == '(') { while (i < (ssize_t)protocolname.length()) { diff --git a/streamApp/test.db b/streamApp/test.db index 0ffa213..1cc4ba5 100644 --- a/streamApp/test.db +++ b/streamApp/test.db @@ -22,20 +22,20 @@ record (stringout, "$(P):cmd") { field (DTYP, "stream") - field (OUT, "@test.proto command terminal") + field (OUT, "@test.proto command terminal") field (PRIO, "HIGH") field (VAL, "") } record (stringout, "$(P):info") { field (DTYP, "stream") - field (OUT, "@test.proto info terminal") + field (OUT, "@test.proto info terminal ") field (PRIO, "HIGH") } record (stringout, "$(P):request") { field (DTYP, "stream") - field (OUT, "@test.proto request($(P):reply.VAL) terminal") + field (OUT, "@test.proto request ($(P):reply.VAL) terminal") field (PRIO, "HIGH") } record (stringin, "$(P):reply") @@ -44,7 +44,7 @@ record (stringin, "$(P):reply") record (stringout, "$(P):checksum") { field (DTYP, "stream") - field (OUT, "@test.proto checksum($(CHKSUM=sum)) terminal") + field (OUT, "@test.proto checksum ($(CHKSUM=sum)) terminal") } record (stringin, "$(P):spy") {