Package: putty / 0.62-9+deb7u3

glib-deprecated-functions.patch Patch series | download
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Description: Avoid deprecated GLib functions
Author: Colin Watson <cjwatson@debian.org>
Forwarded: yes
Applied-Upstream: http://bazaar.launchpad.net/+branch/putty/revision/3403
Last-Update: 2012-01-03

Index: b/unix/gtkfont.c
===================================================================
--- a/unix/gtkfont.c
+++ b/unix/gtkfont.c
@@ -47,6 +47,11 @@
  *    I haven't the energy.
  */
 
+#if !GLIB_CHECK_VERSION(1,3,7)
+#define g_ascii_strcasecmp g_strcasecmp
+#define g_ascii_strncasecmp g_strncasecmp
+#endif
+
 /*
  * Ad-hoc vtable mechanism to allow font structures to be
  * polymorphic.
@@ -524,21 +529,21 @@
 	    style = p;
 	    p += sprintf(p, "%s", components[2][0] ? components[2] :
 			 "regular");
-	    if (!g_strcasecmp(components[3], "i"))
+	    if (!g_ascii_strcasecmp(components[3], "i"))
 		p += sprintf(p, " italic");
-	    else if (!g_strcasecmp(components[3], "o"))
+	    else if (!g_ascii_strcasecmp(components[3], "o"))
 		p += sprintf(p, " oblique");
-	    else if (!g_strcasecmp(components[3], "ri"))
+	    else if (!g_ascii_strcasecmp(components[3], "ri"))
 		p += sprintf(p, " reverse italic");
-	    else if (!g_strcasecmp(components[3], "ro"))
+	    else if (!g_ascii_strcasecmp(components[3], "ro"))
 		p += sprintf(p, " reverse oblique");
-	    else if (!g_strcasecmp(components[3], "ot"))
+	    else if (!g_ascii_strcasecmp(components[3], "ot"))
 		p += sprintf(p, " other-slant");
-	    if (components[4][0] && g_strcasecmp(components[4], "normal"))
+	    if (components[4][0] && g_ascii_strcasecmp(components[4], "normal"))
 		p += sprintf(p, " %s", components[4]);
-	    if (!g_strcasecmp(components[10], "m"))
+	    if (!g_ascii_strcasecmp(components[10], "m"))
 		p += sprintf(p, " [M]");
-	    if (!g_strcasecmp(components[10], "c"))
+	    if (!g_ascii_strcasecmp(components[10], "c"))
 		p += sprintf(p, " [C]");
 	    if (components[5][0])
 		p += sprintf(p, " %s", components[5]);
@@ -550,23 +555,23 @@
 	     */
 	    p++;
 	    stylekey = p;
-	    if (!g_strcasecmp(components[2], "medium") ||
-		!g_strcasecmp(components[2], "regular") ||
-		!g_strcasecmp(components[2], "normal") ||
-		!g_strcasecmp(components[2], "book"))
+	    if (!g_ascii_strcasecmp(components[2], "medium") ||
+		!g_ascii_strcasecmp(components[2], "regular") ||
+		!g_ascii_strcasecmp(components[2], "normal") ||
+		!g_ascii_strcasecmp(components[2], "book"))
 		weightkey = 0;
-	    else if (!g_strncasecmp(components[2], "demi", 4) ||
-		     !g_strncasecmp(components[2], "semi", 4))
+	    else if (!g_ascii_strncasecmp(components[2], "demi", 4) ||
+		     !g_ascii_strncasecmp(components[2], "semi", 4))
 		weightkey = 1;
 	    else
 		weightkey = 2;
-	    if (!g_strcasecmp(components[3], "r"))
+	    if (!g_ascii_strcasecmp(components[3], "r"))
 		slantkey = 0;
-	    else if (!g_strncasecmp(components[3], "r", 1))
+	    else if (!g_ascii_strncasecmp(components[3], "r", 1))
 		slantkey = 2;
 	    else
 		slantkey = 1;
-	    if (!g_strcasecmp(components[4], "normal"))
+	    if (!g_ascii_strcasecmp(components[4], "normal"))
 		setwidthkey = 0;
 	    else
 		setwidthkey = 1;
@@ -774,8 +779,8 @@
 
     matched = FALSE;
     for (i = 0; i < nfamilies; i++) {
-	if (!g_strcasecmp(pango_font_family_get_name(families[i]),
-			  pango_font_description_get_family(desc))) {
+	if (!g_ascii_strcasecmp(pango_font_family_get_name(families[i]),
+				pango_font_description_get_family(desc))) {
 	    matched = TRUE;
 	    break;
 	}
@@ -1393,7 +1398,7 @@
     /*
      * Otherwise, ordinary strcasecmp.
      */
-    return g_strcasecmp(a, b);
+    return g_ascii_strcasecmp(a, b);
 }
 
 static int fontinfo_realname_compare(void *av, void *bv)