From df2b1f120b086b37979f5582f7e91f41d9e8e310 Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Sun, 29 Apr 2012 10:17:56 -0400 Subject: [PATCH] _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. --- configure.ac | 18 ++++++++++++++---- lib/driver/_cdio_generic.c | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 4cf0cb48..e9012a8e 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/lib/driver/_cdio_generic.c b/lib/driver/_cdio_generic.c index 7d908b4c..92335668 100644 --- a/lib/driver/_cdio_generic.c +++ b/lib/driver/_cdio_generic.c @@ -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;