diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-10-05 10:50:00 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-10-05 10:50:00 -0400 |
commit | 9c64dce9ff27c9193417202f797be82fe21140e0 (patch) | |
tree | d4c0efeb8dcd63461923691269e38597c8f310f1 | |
parent | 5f3cdac8c05c023684c639890ee6abce9a8cf6e6 (diff) | |
download | mirror-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.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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)); } |