Browse Source

Check for wordexp() explicitly

pull/117/head
Rémi Denis-Courmont 6 years ago
parent
commit
adfc5b31fa
  1. 2
      configure.ac
  2. 4
      modules/control/cli/cli.c
  3. 4
      modules/control/cli/playlist.c

2
configure.ac

@ -695,7 +695,7 @@ dnl Check for system libs needed
need_libc=false
dnl Check for usual libc functions
AC_CHECK_FUNCS([accept4 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
AC_CHECK_FUNCS([accept4 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale wordexp])
AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
AC_REPLACE_FUNCS([gettimeofday])
AC_CHECK_FUNC(fdatasync,,

4
modules/control/cli/cli.c

@ -296,7 +296,7 @@ static void Process(intf_thread_t *intf, const char *line)
if (*cmd == '\0')
return; /* Ignore empty line */
#ifdef HAVE_WORDEXP_H
#ifdef HAVE_WORDEXP
wordexp_t we;
int val = wordexp(cmd, &we, 0);
@ -343,7 +343,7 @@ error: wordfree(&we);
cb(intf, args, count);
}
#ifdef HAVE_WORDEXP_H
#ifdef HAVE_WORDEXP
free(args);
wordfree(&we);
#endif

4
modules/control/cli/playlist.c

@ -34,7 +34,7 @@
#include "cli.h"
#ifndef HAVE_WORDEXP_H
#ifndef HAVE_WORDEXP
/*****************************************************************************
* parse_MRL: build a input item from a full mrl
*****************************************************************************
@ -410,7 +410,7 @@ static void PlaylistAddCommon(intf_thread_t *intf, const char *const *args,
vlc_playlist_Lock(playlist);
count = vlc_playlist_Count(playlist);
#ifdef HAVE_WORDEXP_H
#ifdef HAVE_WORDEXP
for (size_t i = 1; i < n_args;)
{

Loading…
Cancel
Save