ScriptInterp::getMember VS. ScriptCommand::getMember
"Zhang Le" <[email protected]> Fri, 29 Sep 2006 16:17:54 +0800
| Newsgroups | gmane.comp.gnu.ccscript.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0610034146==
Content-Type: multipart/alternative;
boundary="----=_Part_5025_23930493.1159517874870"
------=_Part_5025_23930493.1159517874870
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
These two getMember's behavior is different.
For example. for "register.sip"
ScriptInterp::getMember's result doesn't include the leading dot, ie. the
result is "sip"
ScriptCommand::getMember's result include the leading dot, ie. the result is
".sip"
Unfortunately, this difference is overlooked sometimes.
For example, in bayonne2-1.5.28 src/checks.cpp, chkSlog function assumes
ScriptCommand::getMember's result doesn't include the leading dot, which is
apparently wrong.
Although we could fix the problem by modifying chkSlog(), I think the better
solution is make the behavior of the two getMember consistent with each
other.
So I propose this ccscript3-ScriptCommand-getMember.patch:
--- src/command.cpp.orig 2006-09-25 16:28:24.000000000 +0800
+++ src/command.cpp 2006-09-25 16:28:56.000000000 +0800
@@ -383,7 +383,12 @@
const char *ScriptCommand::getMember(Line *line)
{
- return strchr(line->cmd, '.');
+ const char *cp = strchr(line->cmd, '.');
+
+ if(cp)
+ ++cp;
+
+ return cp;
}
const char *ScriptCommand::getOption(Line *line, unsigned *idx)
--
Zhang Le, Robert
Linux Engineer/Trainer
http://zhllg.blogspot.com
http://zh.gentoo-wiki.com
http://savannah.nongnu.org/projects/pgubook
http://groups.google.com/group/gentoo-china
http://groups.google.com/group/szlug
------=_Part_5025_23930493.1159517874870
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
These two getMember's behavior is different.<br>For example. for "register.sip" <br>ScriptInterp::getMember's result doesn't include the leading dot, ie. the result is "sip"<br>ScriptCommand::getMember's result include the leading dot, ie. the result is ".sip"
<br><br clear="all">Unfortunately, this difference is overlooked sometimes.<br>For example, in bayonne2-1.5.28 src/checks.cpp, chkSlog function assumes ScriptCommand::getMember's result doesn't include the leading dot, which is apparently wrong.
<br><br>Although we could fix the problem by modifying chkSlog(), I think the better solution is make the behavior of the two getMember consistent with each other.<br><br>So I propose this ccscript3-ScriptCommand-getMember.patch
:<br><br>--- src/command.cpp.orig 2006-09-25 16:28:24.000000000 +0800<br>+++ src/command.cpp 2006-09-25 16:28:56.000000000 +0800<br>@@ -383,7 +383,12 @@<br><br> const char *ScriptCommand::getMember(Line *line)<br>
{<br>- return strchr(line->cmd, '.');<br>+ const char *cp = strchr(line->cmd, '.');<br>+<br>+ if(cp)<br>+ ++cp;<br>+<br>+ return cp;<br> }<br><br> const char *ScriptCommand::getOption(Line *line, unsigned *idx)
<br><br>-- <br>Zhang Le, Robert<br>Linux Engineer/Trainer<br><a href="http://zhllg.blogspot.com">http://zhllg.blogspot.com</a><br><a href="http://zh.gentoo-wiki.com">http://zh.gentoo-wiki.com</a><br><a href="http://savannah.nongnu.org/projects/pgubook">
http://savannah.nongnu.org/projects/pgubook</a><br><a href="http://groups.google.com/group/gentoo-china">http://groups.google.com/group/gentoo-china</a><br><a href="http://groups.google.com/group/szlug">http://groups.google.com/group/szlug
</a>
------=_Part_5025_23930493.1159517874870--
--===============0610034146==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ccscript-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccscript-devel
--===============0610034146==--