mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-16 08:56:42 -05:00
Use snd_user_file() in pcm_ladpsa.c
Use snd_user_file() in pcm_ladpsa.c to get rid of wordexp.
This commit is contained in:
parent
0d708373f1
commit
d9680921a9
1 changed files with 6 additions and 15 deletions
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <wordexp.h>
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include "pcm_local.h"
|
#include "pcm_local.h"
|
||||||
#include "pcm_plugin.h"
|
#include "pcm_plugin.h"
|
||||||
|
|
@ -815,26 +814,18 @@ static int snd_pcm_ladspa_look_for_plugin(snd_pcm_ladspa_plugin_t * const plugin
|
||||||
{
|
{
|
||||||
const char *c;
|
const char *c;
|
||||||
size_t l;
|
size_t l;
|
||||||
wordexp_t we;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
for (c = path; (l = strcspn(c, ": ")) > 0; ) {
|
for (c = path; (l = strcspn(c, ": ")) > 0; ) {
|
||||||
char name[l + 1];
|
char name[l + 1];
|
||||||
|
char *fullpath;
|
||||||
memcpy(name, c, l);
|
memcpy(name, c, l);
|
||||||
name[l] = 0;
|
name[l] = 0;
|
||||||
err = wordexp(name, &we, WRDE_NOCMD);
|
err = snd_user_file(name, &fullpath);
|
||||||
switch (err) {
|
if (err < 0)
|
||||||
case WRDE_NOSPACE:
|
return err;
|
||||||
return -ENOMEM;
|
err = snd_pcm_ladspa_check_dir(plugin, fullpath, label, ladspa_id);
|
||||||
case 0:
|
free(fullpath);
|
||||||
if (we.we_wordc == 1)
|
|
||||||
break;
|
|
||||||
/* Fall through */
|
|
||||||
default:
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
err = snd_pcm_ladspa_check_dir(plugin, we.we_wordv[0], label, ladspa_id);
|
|
||||||
wordfree(&we);
|
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
if (err > 0)
|
if (err > 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue