_cdio_generic.c: Initialize new scsi_tuple field. Removes SEGV in OSX and others.

configure.ac: Try sed -r and -E rather than rely on OS type.
This commit is contained in:
R. Bernstein
2012-04-29 10:17:56 -04:00
parent 37cca69f1d
commit df2b1f120b
2 changed files with 15 additions and 4 deletions

View File

@@ -314,7 +314,21 @@ AC_SUBST(LIBCDIO_DEPS)
AC_SUBST(LIBISO9660_LIBS)
AC_SUBST(LIBUDF_LIBS)
AC_MSG_CHECKING([Checking what sed uses for extended regular expressions])
SED_EXTENDED_RE_FLAG='-r'
result=$(echo 'define' | $ac_path_SED -r -e 's/^define/foo/' 2>/dev/null)
if [[ $? -ne 0 ]] ; then
result=$(echo 'define' | $ac_path_SED -r -E 's/^define/foo/' 2>/dev/null)
if [[ $? -ne 0 ]] ; then
SED_EXTENDED_RE_FLAG='-E'
else
AC_MSG_WARN([Don't have SED that understand extended RE's. Some minor compilation issues may fail.])
SED_EXTENDED_RE_FLAG=''
fi
fi
AC_MSG_RESULT($SED_EXTENDED_RE_FLAG)
AC_SUBST(SED_EXTENDED_RE_FLAG)
dnl Libtool flag for strict linkage
LT_NO_UNDEFINED=
@@ -326,7 +340,6 @@ case $host_os in
## [Define 1 if you have AIX CD-ROM support])
;;
darwin[[6-9]].*|darwin1[[0-2]].*)
SED_EXTENDED_RE_FLAG='-E'
AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h,
[have_iokit_h="yes"])
if test "x$have_iokit_h" = "xyes" ; then
@@ -416,14 +429,12 @@ int has_timeout=sizeof(test.timeout);],
enable_cdda_player="no"
;;
freebsd4.*|freebsd5.*|freebsd[[6-9]].*|dragonfly*|kfreebsd*)
SED_EXTENDED_RE_FLAG='-E'
AC_DEFINE([HAVE_FREEBSD_CDROM], [1],
[Define 1 if you have FreeBSD CD-ROM support])
LIBS="$LIBS -lcam"
cd_drivers="${cd_drivers}, FreeBSD "
;;
netbsd*)
SED_EXTENDED_RE_FLAG='-E'
AC_DEFINE([HAVE_NETBSD_CDROM], [1],
[Define 1 if you have NetBSD CD-ROM support])
# LIBS="$LIBS -lcam"
@@ -442,7 +453,6 @@ int has_timeout=sizeof(test.timeout);],
;;
esac
AC_SUBST(SED_EXTENDED_RE_FLAG)
AC_SUBST(LIBCDIO_CFLAGS)
AC_SUBST(LIBISO9660_CFLAGS)
AC_SUBST(LT_NO_UNDEFINED)

View File

@@ -144,6 +144,7 @@ cdio_generic_init (void *user_data, int open_flags)
p_env->init = true;
p_env->toc_init = false;
p_env->cdtext = NULL;
p_env->scsi_tuple = NULL;
p_env->b_cdtext_error = false;
p_env->i_joliet_level = 0; /* Assume no Joliet extensions initally */
return true;