From: Takashi Iwai Date: Tue, 29 Nov 2005 15:25:56 +0000 (+0000) Subject: Add a workaround for systems without wordexp X-Git-Tag: v1.0.11rc1~12 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=d4dd7650f9ff34916929188e2d8f3e0046cb391d;p=alsa-lib.git Add a workaround for systems without wordexp Add a workaround for systems without wordexp (e.g. ulibc). --- diff --git a/src/userfile.c b/src/userfile.c index 38bf6515..173171e6 100644 --- a/src/userfile.c +++ b/src/userfile.c @@ -18,6 +18,9 @@ * */ +#include + +#ifdef HAVE_WORDEXP_H #include #include #include @@ -56,3 +59,14 @@ int snd_user_file(const char *file, char **result) wordfree(&we); return 0; } + +#else /* !HAVE_WORDEXP_H */ +/* just copy the string - would be nicer to expand by ourselves, though... */ +int snd_user_file(const char *file, char **result) +{ + *result = strdup(file); + if (! *result) + return -ENOMEM; + return 0; +} +#endif /* HAVE_WORDEXP_H */