From 7df10f78c6ad6e661f3d82b3ce7b412995482c7c Mon Sep 17 00:00:00 2001 From: Christoph Hohmann Date: Fri, 6 Jun 2003 22:09:46 +0000 Subject: [PATCH] 0.9.0claws16 * configure.ac * src/mimeview.h add check for fnmatch.h and include it when available * src/mimeview.[ch] fix wrong case sensitivity of Content-Types * src/gtk/Makefile.am need the same include paths in gtk directory as in common directory because .h files in common can include files from these directories, when included in gtk's .h or .c files --- ChangeLog.claws | 15 +++++++++++++++ configure.ac | 4 ++-- src/gtk/Makefile.am | 3 ++- src/mimeview.c | 16 +++++++++++++++- src/mimeview.h | 4 ++++ 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 05608b1cc..d0364cbae 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,18 @@ +2003-06-06 [christoph] 0.9.0claws16 + + * configure.ac + * src/mimeview.h + add check for fnmatch.h and include it when available + + * src/mimeview.[ch] + fix wrong case sensitivity of Content-Types + + * src/gtk/Makefile.am + need the same include paths in gtk directory as in + common directory because .h files in common can + include files from these directories, when included + in gtk's .h or .c files + 2003-06-06 [alfons] 0.9.0claws15 * src/mimeview.c diff --git a/configure.ac b/configure.ac index 80e0b366f..2dff4d01e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws15 +EXTRA_VERSION=claws16 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target @@ -128,7 +128,7 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \ sys/param.h sys/utsname.h sys/select.h \ - wchar.h wctype.h) + wchar.h wctype.h fnmatch.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/src/gtk/Makefile.am b/src/gtk/Makefile.am index 94d68f86d..ba395c506 100644 --- a/src/gtk/Makefile.am +++ b/src/gtk/Makefile.am @@ -14,10 +14,11 @@ libsylpheedgtk_la_SOURCES = \ prefswindow.c prefswindow.h \ sslcertwindow.c sslcertwindow.h -INCLUDES = \ +CPPFLAGS = \ -I../common \ -I.. \ $(GTK_CFLAGS) + $(OPENSSL_CFLAGS) libsylpheedgtk_la_LIBADD = \ ../common/libsylpheedcommon.la \ diff --git a/src/mimeview.c b/src/mimeview.c index d73931784..3a5d678f8 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -36,6 +36,9 @@ #include #include #include +#ifdef HAVE_FNMATCH_H +#include +#endif #include "intl.h" #include "main.h" @@ -478,6 +481,17 @@ static MimeViewer *get_viewer_for_content_type(MimeView *mimeview, const gchar * GSList *cur; MimeViewerFactory *factory = NULL; MimeViewer *viewer = NULL; + +/* + * FNM_CASEFOLD is a GNU extension + * if its not defined copy the string to the stack and + * convert the copy to lower case + */ +#ifndef FNM_CASEFOLD +#define FNM_CASEFOLD 0 + Xstrdup_a(content_type, content_type, return NULL); + g_strdown((gchar *)content_type); +#endif for (cur = mimeviewer_factories; cur != NULL; cur = g_slist_next(cur)) { MimeViewerFactory *curfactory = cur->data; @@ -485,7 +499,7 @@ static MimeViewer *get_viewer_for_content_type(MimeView *mimeview, const gchar * while (curfactory->content_types[i] != NULL) { debug_print("%s\n", curfactory->content_types[i]); - if(!fnmatch(curfactory->content_types[i], content_type, 0)) { + if(!fnmatch(curfactory->content_types[i], content_type, FNM_CASEFOLD)) { factory = curfactory; break; } diff --git a/src/mimeview.h b/src/mimeview.h index a8bea564e..5411b1c21 100644 --- a/src/mimeview.h +++ b/src/mimeview.h @@ -74,6 +74,10 @@ struct _MimeView struct _MimeViewerFactory { + /** + * Array of supported content types. + * Must be NULL terminated and lower case + */ gchar **content_types; gint priority; -- 2.25.1