1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-07-02 14:04:22 +00:00

Show --builtin even when no actions are found.

This commit is contained in:
King_DuckZ 2016-02-11 09:18:36 +01:00
parent c89d4b69d5
commit 5549e7c97d
2 changed files with 8 additions and 3 deletions

View file

@ -42,6 +42,7 @@ void find_actions (char*** parOut, size_t* parCount) {
list.count = 0;
foreach_dir(&increase_actionlist, &list);
if (0 == list.count) {
*parOut = NULL;
return;
}
@ -60,7 +61,9 @@ void free_actions (char** parActions, size_t parCount) {
for (z = 0; z < parCount; ++z) {
free(parActions[z]);
}
free(parActions);
if (parActions) {
free(parActions);
}
}
static void foreach_dir (void(*parAction)(const char*, ActionList*), ActionList* parList) {

View file

@ -40,9 +40,11 @@ int main (int parArgc, char* parArgv[]) {
char** argv;
FILE* streamout;
int retval;
int showbuiltin;
showbuiltin = (parArgc >= 2 ? not strcmp("--builtin", parArgv[1]) : 0);
find_actions(&actions, &actions_count);
if (0 == actions_count) {
if (0 == actions_count and not showbuiltin) {
fprintf(stderr, "No actions found in \"%s\"\n", ACTIONS_SEARCH_PATH);
return 1;
}
@ -64,7 +66,7 @@ int main (int parArgc, char* parArgv[]) {
free_actions(actions, actions_count);
return retval;
}
else if (strcmp("--builtin", parArgv[1]) == 0) {
else if (showbuiltin) {
print_builtin_feats();
free_actions(actions, actions_count);
return 0;