- if (opt_pd_stack) {
- pds = g_strsplit(opt_pd_stack, ",", 0);
- if (g_strv_length(pds) < 2) {
- printf("Specify at least two protocol decoders to stack.\n");
- return 1;
- }
+ pds = g_strsplit(opt_pds, ",", 0);
+ if (g_strv_length(pds) > 1) {
+ if (opt_pd_stack) {
+ /* A stack setup was specified, use that. */
+ g_strfreev(pds);
+ pds = g_strsplit(opt_pd_stack, ",", 0);
+ if (g_strv_length(pds) < 2) {
+ g_strfreev(pds);
+ printf("Specify at least two protocol decoders to stack.\n");
+ return 1;
+ }
+ }