projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/iceman1001/proxmark3
[proxmark3-svn]
/
client
/
cmdscript.c
diff --git
a/client/cmdscript.c
b/client/cmdscript.c
index fd02d13a9151b10c01a1249ca712013cb8a463ed..e9ec587110142e258688c517abf6099df5256fb6 100644
(file)
--- a/
client/cmdscript.c
+++ b/
client/cmdscript.c
@@
-64,7
+64,7
@@
int str_ends_with(const char * str, const char * suffix) {
*/
int CmdHelp(const char * Cmd)
{
*/
int CmdHelp(const char * Cmd)
{
- PrintAndLog("This is a feature to run Lua-scripts. You can place lua-scripts within the
scripts/-folder.
");
+ PrintAndLog("This is a feature to run Lua-scripts. You can place lua-scripts within the
´client/scripts/´ folder.
");
return 0;
}
return 0;
}
@@
-83,8
+83,8
@@
int CmdList(const char *Cmd)
{
while ((ep = readdir (dp)) != NULL)
{
{
while ((ep = readdir (dp)) != NULL)
{
- if(
str_ends_with(ep->d_name, ".lua"))
- PrintAndLog("%-
16
s %s", ep->d_name, "A script file");
+ if(str_ends_with(ep->d_name, ".lua"))
+ PrintAndLog("%-
21
s %s", ep->d_name, "A script file");
}
(void) closedir (dp);
}
}
(void) closedir (dp);
}
@@
-98,10
+98,10
@@
int CmdList(const char *Cmd)
* @param Cmd
* @return
*/
* @param Cmd
* @return
*/
-int CmdScript(const char *Cmd)
-{
- CmdsParse(CommandTable, Cmd);
- return 0;
+int CmdScript(const char *Cmd)
{
+ clearCommandBuffer();
+
CmdsParse(CommandTable, Cmd);
+
return 0;
}
/**
* Utility to check the ending of a string (used to check file suffix)
}
/**
* Utility to check the ending of a string (used to check file suffix)
@@
-152,17
+152,13
@@
int CmdRun(const char *Cmd)
char buf[256];
snprintf(buf, sizeof buf, "./scripts/%s%s", script_name, suffix);
char buf[256];
snprintf(buf, sizeof buf, "./scripts/%s%s", script_name, suffix);
- printf("--- Executing: %s, args'%s'\n",buf,arguments);
-
-
-
+ printf("--- Executing: %s, args'%s'\n", buf, arguments);
// run the Lua script
int error = luaL_loadfile(lua_state, buf);
if(!error)
{
// run the Lua script
int error = luaL_loadfile(lua_state, buf);
if(!error)
{
-
lua_pushstring(lua_state, arguments);
lua_setglobal(lua_state, "args");
lua_pushstring(lua_state, arguments);
lua_setglobal(lua_state, "args");
Impressum
,
Datenschutz