Revision: 41556
http://brlcad.svn.sourceforge.net/brlcad/?rev=41556&view=rev
Author: brlcad
Date: 2010-12-07 23:29:56 +0000 (Tue, 07 Dec 2010)
Log Message:
-----------
allow the command table to have a negative max count, effectively implying
unlimited.
Modified Paths:
--------------
brlcad/trunk/src/librt/cmd.c
Modified: brlcad/trunk/src/librt/cmd.c
===================================================================
--- brlcad/trunk/src/librt/cmd.c 2010-12-07 23:25:32 UTC (rev 41555)
+++ brlcad/trunk/src/librt/cmd.c 2010-12-07 23:29:56 UTC (rev 41556)
@@ -124,7 +124,8 @@
*
* Slice up input buffer into whitespace separated "words", look up
* the first word as a command, and if it has the correct number of
- * args, call that function.
+ * args, call that function. Negative min/max values in the tp
+ * command table effectively mean that they're not bounded.
*
* Expected to return -1 to halt command processing loop.
*
@@ -158,7 +159,9 @@
/* the length of "n" is not significant, just needs to be big
enough */
strncmp(cmd_args[0], tp->ct_cmd, MAXWORDS) != 0)
continue;
- if ((nwords >= tp->ct_min) && (nwords <= tp->ct_max)) {
+ if ((nwords >= tp->ct_min)
+ && ((tp->ct_max < 0) || (nwords <= tp->ct_max)))
+ {
retval = tp->ct_func(nwords, cmd_args);
bu_free(lp, "rt_do_cmd lp");
return retval;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits