diff --git a/configure.ac b/configure.ac index 3350365a..911e86e3 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ define(RELEASE_NUM, 71) define(CDIO_VERSION_STR, 0.$1cvs) AC_PREREQ(2.52) -AC_REVISION([$Id: configure.ac,v 1.103 2004/10/30 00:38:43 rocky Exp $])dnl +AC_REVISION([$Id: configure.ac,v 1.104 2004/10/30 02:55:17 rocky Exp $])dnl AC_INIT(libcdio, CDIO_VERSION_STR(RELEASE_NUM)) AC_CONFIG_SRCDIR(src/cd-info.c) AM_INIT_AUTOMAKE @@ -114,7 +114,7 @@ AM_PATH_LIBPOPT(, dnl headers AC_HEADER_STDC -AC_CHECK_HEADERS(glob.h stdbool.h) +AC_CHECK_HEADERS(glob.h stdbool.h langinfo.h) dnl compiler AC_C_BIGENDIAN @@ -317,7 +317,7 @@ AC_DEFINE_UNQUOTED(LICDIO_SOURCE_PATH, "$LIBCDIO_SOURCE_PATH", [Full path to libcdio top_sourcedir.]) AC_SUBST(LIBCDIO_SOURCE_PATH) -AC_CHECK_FUNCS( memset bzero memcpy tzset ) +AC_CHECK_FUNCS( memset bzero memcpy tzset nl_langinfo ) AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE(HAVE_TM_GMTOFF, 1, @@ -343,7 +343,23 @@ int [Define if time.h defines extern long timezone and int daylight vars.]) has_daylight=yes ],[has_daylight=no]) - AC_MSG_RESULT($has_daylight) + AC_MSG_RESULT($has_daylight) + AC_MSG_CHECKING([whether time.h defines tzname variable]) + AC_TRY_RUN([ +#include + + + extern char *tzname[2]; + +int + main() { + return (tzname != NULL); +} + ],[AC_DEFINE(HAVE_TZNAME, 1, + [Define if time.h defines extern extern char *tzname[2] variable]) + has_tzname=yes + ],[has_tzname=no]) + AC_MSG_RESULT($has_tzname) fi if test x$enable_joliet = x; then diff --git a/lib/iso9660.c b/lib/iso9660.c index bff1b8a3..a99b00d9 100644 --- a/lib/iso9660.c +++ b/lib/iso9660.c @@ -1,5 +1,5 @@ /* - $Id: iso9660.c,v 1.23 2004/10/30 00:38:43 rocky Exp $ + $Id: iso9660.c,v 1.24 2004/10/30 02:55:17 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -37,7 +37,7 @@ #include #endif -static const char _rcsid[] = "$Id: iso9660.c,v 1.23 2004/10/30 00:38:43 rocky Exp $"; +static const char _rcsid[] = "$Id: iso9660.c,v 1.24 2004/10/30 02:55:17 rocky Exp $"; /* some parameters... */ #define SYSTEM_ID "CD-RTOS CD-BRIDGE" @@ -101,7 +101,9 @@ iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime, #if defined(HAVE_TM_GMTOFF) && defined(HAVE_TZSET) if (b_localtime) { tzset(); +#if defined(HAVE_TZNAME) p_tm->tm_zone = (char *) tzname; +#endif #if defined(HAVE_DAYLIGHT) p_tm->tm_isdst = daylight; p_tm->tm_gmtoff = timezone; diff --git a/lib/iso9660_fs.c b/lib/iso9660_fs.c index d2434a82..39d92651 100644 --- a/lib/iso9660_fs.c +++ b/lib/iso9660_fs.c @@ -1,5 +1,5 @@ /* - $Id: iso9660_fs.c,v 1.37 2004/10/29 02:11:48 rocky Exp $ + $Id: iso9660_fs.c,v 1.38 2004/10/30 02:55:17 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -35,7 +35,9 @@ # include #endif +#ifdef HAVE_LANGINFO #include +#endif #include #include @@ -49,7 +51,7 @@ #include -static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.37 2004/10/29 02:11:48 rocky Exp $"; +static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.38 2004/10/30 02:55:17 rocky Exp $"; /* Implementation of iso9660_t type */ struct _iso9660 { @@ -144,7 +146,11 @@ static bool ucs2be_to_locale(ICONV_CONST char *psz_ucs2be, size_t i_inlen, char **p_psz_out, size_t i_outlen) { +#ifdef HAVE_NL_LANGINFO iconv_t ic = iconv_open(nl_langinfo(CODESET), "UCS-2BE"); +#else + iconv_t ic = iconv_open("ASCII", "UCS-2BE"); +#endif int rc; char *psz_buf = NULL; char *psz_buf2; diff --git a/src/iso-info.c b/src/iso-info.c index 9cc60ccf..009633e7 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,5 +1,5 @@ /* - $Id: iso-info.c,v 1.15 2004/10/29 02:11:48 rocky Exp $ + $Id: iso-info.c,v 1.16 2004/10/30 02:55:17 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -288,7 +288,7 @@ main(int argc, const char *argv[]) } if (source_name==NULL) { - err_exit("No input device given/found\n"); + err_exit("No input device given/found%s\n", ""); } if (opts.no_joliet) { @@ -299,7 +299,7 @@ main(int argc, const char *argv[]) if (p_iso==NULL) { free(source_name); - err_exit("Error in opening ISO-9660 image\n"); + err_exit("Error in opening ISO-9660 image%s\n", ""); } if (opts.silent == 0) {