aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-10-05 10:50:00 -0400
committerDave Reisner <dreisner@archlinux.org>2012-10-05 10:50:00 -0400
commit9c64dce9ff27c9193417202f797be82fe21140e0 (patch)
treed4c0efeb8dcd63461923691269e38597c8f310f1
parent5f3cdac8c05c023684c639890ee6abce9a8cf6e6 (diff)
downloadmirror-ponymix-9c64dce9ff27c9193417202f797be82fe21140e0.tar.gz
mirror-ponymix-9c64dce9ff27c9193417202f797be82fe21140e0.tar.bz2
mirror-ponymix-9c64dce9ff27c9193417202f797be82fe21140e0.zip
fix totally backwards strstr matching
This never could have worked except on exact matches. The arguments to strstr were reversed, and barring that, interesting results were filtered OUT.
-rw-r--r--ponymix.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ponymix.c b/ponymix.c
index c7eff30..028e401 100644
--- a/ponymix.c
+++ b/ponymix.c
@@ -284,7 +284,7 @@ static void sink_add_cb(pa_context UNUSED *c, const pa_sink_info *i, int eol,
struct cb_data_t *pony = raw;
if (eol)
return;
- if (pony->glob && strstr(pony->glob, i->name) != NULL)
+ if (pony->glob && strstr(i->name, pony->glob) == NULL)
return;
io_list_add(pony->list, sink_new(i));
}
@@ -295,8 +295,8 @@ static void sink_input_add_cb(pa_context UNUSED *c, const pa_sink_input_info *i,
struct cb_data_t *pony = raw;
if (eol)
return;
- if (pony->glob && !(strstr(pony->glob, i->name) == NULL ||
- strstr(pony->glob, pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_NAME)) == NULL))
+ if (pony->glob && strstr(i->name, pony->glob) == NULL &&
+ strstr(pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_NAME), pony->glob) == NULL)
return;
io_list_add(pony->list, sink_input_new(i));
}
@@ -306,7 +306,7 @@ static void source_add_cb(pa_context UNUSED *c, const pa_source_info *i, int eol
struct cb_data_t *pony = raw;
if (eol)
return;
- if (pony->glob && strstr(pony->glob, i->name) != NULL)
+ if (pony->glob && strstr(i->name, pony->glob) == NULL)
return;
io_list_add(pony->list, source_new(i));
}
@@ -317,8 +317,8 @@ static void source_output_add_cb(pa_context UNUSED *c, const pa_source_output_in
struct cb_data_t *pony = raw;
if (eol)
return;
- if (pony->glob && !(strstr(pony->glob, i->name) == NULL ||
- strstr(pony->glob, pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_NAME)) == NULL))
+ if (pony->glob && strstr(i->name, pony->glob) == NULL &&
+ strstr(pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_NAME), pony->glob) == NULL)
return;
io_list_add(pony->list, source_output_new(i));
}