ccscript-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccscript-devel] ScriptInterp::getMember VS. ScriptCommand::getMember


From: Zhang Le
Subject: [Ccscript-devel] ScriptInterp::getMember VS. ScriptCommand::getMember
Date: Fri, 29 Sep 2006 16:17:54 +0800

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
reply via email to

[Prev in Thread] Current Thread [Next in Thread]