- char cmd_name[32];
- int len = 0;
- memset(cmd_name, 0, 32);
- sscanf(Cmd, "%31s%n", cmd_name, &len);
+// char cmd_name[32];
+// memset(cmd_name, 0, 32);
+// sscanf(Cmd, "%31s%n", cmd_name, &len);
+
+ char script_name[128] = {0};
+ char arguments[256] = {0};
+
+ int name_len = 0;
+ int arg_len = 0;
+ sscanf(Cmd, "%127s%n %255[^\n\r]%n", script_name,&name_len, arguments, &arg_len);
+
+ char *suffix = "";
+ if(!endsWith(script_name,".lua"))
+ {
+ suffix = ".lua";
+ }