0.9.0claws16
authorChristoph Hohmann <reboot@gmx.ch>
Fri, 6 Jun 2003 22:09:46 +0000 (22:09 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Fri, 6 Jun 2003 22:09:46 +0000 (22:09 +0000)
* 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
configure.ac
src/gtk/Makefile.am
src/mimeview.c
src/mimeview.h

index 05608b1..d0364cb 100644 (file)
@@ -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
index 80e0b36..2dff4d0 100644 (file)
@@ -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
index 94d68f8..ba395c5 100644 (file)
@@ -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 \
index d739317..3a5d678 100644 (file)
@@ -36,6 +36,9 @@
 #include <gtk/gtkdnd.h>
 #include <gtk/gtkselection.h>
 #include <stdio.h>
+#ifdef HAVE_FNMATCH_H
+#include <fnmatch.h>
+#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;
                        }
index a8bea56..5411b1c 100644 (file)
@@ -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;