mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
CHG: syntax sugar
This commit is contained in:
parent
cb1ba30a5e
commit
bd94b97883
1 changed files with 14 additions and 13 deletions
|
@ -72,26 +72,27 @@ int CmdHelp(const char * Cmd)
|
||||||
* Generate list of available commands, what it does is
|
* Generate list of available commands, what it does is
|
||||||
* generate a file listing of the script-directory for files
|
* generate a file listing of the script-directory for files
|
||||||
* ending with .lua
|
* ending with .lua
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
int CmdList(const char *Cmd)
|
int CmdList(const char *Cmd)
|
||||||
{
|
{
|
||||||
DIR *dp;
|
|
||||||
struct dirent *ep;
|
struct dirent *ep;
|
||||||
dp = opendir ("./scripts/");
|
DIR *dp = opendir ("./scripts/");
|
||||||
|
if ( dp == NULL ) {
|
||||||
|
PrintAndLog ("Couldn't open the scripts-directory");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (dp != NULL)
|
while ((ep = readdir (dp)) != NULL)
|
||||||
{
|
{
|
||||||
while ((ep = readdir (dp)) != NULL)
|
if(str_ends_with(ep->d_name, ".lua"))
|
||||||
{
|
PrintAndLog("%-21s %s", ep->d_name, "A script file");
|
||||||
if(str_ends_with(ep->d_name, ".lua"))
|
}
|
||||||
PrintAndLog("%-21s %s", ep->d_name, "A script file");
|
(void) closedir (dp);
|
||||||
}
|
|
||||||
(void) closedir (dp);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
PrintAndLog ("Couldn't open the scripts-directory");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a matching script-file
|
* Finds a matching script-file
|
||||||
* @brief CmdScript
|
* @brief CmdScript
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue