summaryrefslogtreecommitdiff
path: root/x11/efltk/patches/patch-ag
blob: 07fecaecade101397e6daca1d88875fc10f6ce53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$NetBSD: patch-ag,v 1.1 2006/02/18 14:07:54 joerg Exp $

--- src/core/Fl_Style.cpp.orig	2003-02-02 10:50:33.000000000 +0000
+++ src/core/Fl_Style.cpp
@@ -284,21 +284,34 @@ Fl_Theme Fl_Style::load_theme(const char
 
 Fl_Theme Fl_Style::load_theme(const char* name)
 {
+    static const char so_suffix[] = ".so";
+    const char *suffix = so_suffix;
+
     // no name leaves the built-in default:
     if (!name || !*name) return fltk_theme;
 
+retry:
     // add ".theme" if it is not there:
     char name_buf[FL_PATH_MAX];
     int n = strlen(name);
     if (n < 6 || strcasecmp(name+n-6, ".theme"))
     {
-        snprintf(name_buf, FL_PATH_MAX, "%s.theme", name);
+        snprintf(name_buf, FL_PATH_MAX, "%s.theme%s", name, suffix);
+        name = name_buf;
+    } else {
+	snprintf(name_buf, FL_PATH_MAX, "%s%s", name, suffix);
         name = name_buf;
     }
 
+    
+
     // search for the file:
     const char *path = fl_find_config_file(name);
     if (!path) {
+        if (suffix == so_suffix) {
+	  suffix = "";
+	  goto retry;
+	}
         // If they said "default" it is ok if the plugin is not found:
         if (!strncmp(name, "default.", 8)) return fltk_theme;
         return 0;