create empty group if a trigger is spec

#144
This commit is contained in:
ruti 2024-09-23 14:56:03 +03:00
parent f11f5b0d67
commit 77ac202f5c

6
main.c
View File

@ -479,6 +479,7 @@ int main(int argc, char **argv)
long val = 0; long val = 0;
char *end = 0; char *end = 0;
bool all_limited = 1;
struct desync_params *dp = add((void *)&params.dp, struct desync_params *dp = add((void *)&params.dp,
&params.dp_count, sizeof(struct desync_params)); &params.dp_count, sizeof(struct desync_params));
@ -573,6 +574,9 @@ int main(int argc, char **argv)
break; break;
case 'A': case 'A':
if (!(dp->hosts || dp->proto || dp->pf[0] || dp->detect)) {
all_limited = 0;
}
dp = add((void *)&params.dp, &params.dp_count, dp = add((void *)&params.dp, &params.dp_count,
sizeof(struct desync_params)); sizeof(struct desync_params));
if (!dp) { if (!dp) {
@ -866,7 +870,7 @@ int main(int argc, char **argv)
clear_params(); clear_params();
return -1; return -1;
} }
if (dp->hosts || dp->proto || dp->pf[0]) { if (all_limited) {
dp = add((void *)&params.dp, dp = add((void *)&params.dp,
&params.dp_count, sizeof(struct desync_params)); &params.dp_count, sizeof(struct desync_params));
if (!dp) { if (!dp) {