]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Add a workaround for systems without wordexp
authorTakashi Iwai <tiwai@suse.de>
Tue, 29 Nov 2005 15:25:56 +0000 (15:25 +0000)
committerTakashi Iwai <tiwai@suse.de>
Tue, 29 Nov 2005 15:25:56 +0000 (15:25 +0000)
Add a workaround for systems without wordexp (e.g. ulibc).

src/userfile.c

index 38bf6515cdaa41def258b4d021017e256346aa43..173171e6f9049579062873a8dc07cf7a518c9928 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
   
+#include <config.h>
+
+#ifdef HAVE_WORDEXP_H
 #include <string.h>
 #include <errno.h>
 #include <wordexp.h>
@@ -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 */