aboutsummaryrefslogtreecommitdiffstats
path: root/tbl_qcmd.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-04-20 10:43:28 +0100
committerFreeArtMan <dos21h@gmail.com>2017-04-20 10:43:28 +0100
commit5007608202739ed1835ffc10a54dba02bc0f361f (patch)
tree47baa281b0c767c5732025a39b74ca9d9f4785c5 /tbl_qcmd.c
parentac515d5ab9cebc863d5c34eaa2183c67c6e412d5 (diff)
downloadagni-5007608202739ed1835ffc10a54dba02bc0f361f.tar.gz
agni-5007608202739ed1835ffc10a54dba02bc0f361f.zip
Add command executor command check
Diffstat (limited to 'tbl_qcmd.c')
-rw-r--r--tbl_qcmd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tbl_qcmd.c b/tbl_qcmd.c
index 4af9de8..deef61f 100644
--- a/tbl_qcmd.c
+++ b/tbl_qcmd.c
@@ -49,6 +49,24 @@ int tbl_exec_add(tbl_exec *tbl, tble_exec *cmd)
int tbl_exec_in_s(tbl_exec *tbl, char *cmd)
{
+ int i;
+ tble_exec *el=NULL;
+
+ if ((tbl == NULL) || (cmd == NULL))
+ {
+ PERM();
+ return -1;
+ }
+
+ for (i=0; i<tbl->size; i++)
+ {
+ el = tbl->cmd[i];
+ if (strncmp(el->cmd, cmd, strlen(el->cmd))==0)
+ {
+ return i;
+ }
+ }
+
return -1;
}