summaryrefslogtreecommitdiff
path: root/liblangtag/liblangtag-0.4.0-mac.patch
blob: dc447586463760e8ee3b5153ee3aace53646328d (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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
diff -r -u liblangtag-0.4.0.org/data/reg2xml.c liblangtag-0.4.0/data/reg2xml.c
--- misc/liblangtag-0.4.0.org/data/reg2xml.c	2012-11-06 09:15:59.000000000 -0600
+++ misc/build/liblangtag-0.4.0/data/reg2xml.c	2012-11-06 09:33:59.000000000 -0600
@@ -111,7 +111,9 @@
 						fsetpos(fp, &pos);
 					}
 					token = strstr(buffer, ": ");
-					tag = strndup(buffer, token - buffer);
+					tag = malloc((token-buffer) + 1);
+					strncpy(tag, buffer, token-buffer);
+					tag[token-buffer] = 0;
 					token += 2;
 					xmlNewChild(ent, NULL,
 						    (const xmlChar *)lt_strlower(tag),
diff -r -u liblangtag-0.4.0.org/liblangtag/lt-atomic.h liblangtag-0.4.0/liblangtag/lt-atomic.h
--- misc/liblangtag-0.4.0.org/liblangtag/lt-atomic.h	2012-11-06 09:15:59.000000000 -0600
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-atomic.h	2012-11-06 09:24:15.000000000 -0600
@@ -93,7 +93,7 @@
 {
 	lt_bool_t retval;
 
-	lt_return_if_fail (v != NULL, FALSE);
+	lt_return_val_if_fail (v != NULL, FALSE);
 
 	pthread_mutex_lock(&__lt_atomic_lock);
 	retval = --(*v) == 0;
diff -r -u liblangtag-0.4.0.org/liblangtag/lt-error.c liblangtag-0.4.0/liblangtag/lt-error.c
--- misc/liblangtag-0.4.0.org/liblangtag/lt-error.c	2012-11-06 09:15:59.000000000 -0600
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-error.c	2012-11-06 09:18:23.000000000 -0600
@@ -14,7 +14,6 @@
 #include "config.h"
 #endif
 
-#include <execinfo.h>
 #include <stdlib.h>
 #include "lt-list.h"
 #include "lt-mem.h"
@@ -98,9 +97,7 @@
 	     ...)
 {
 	va_list ap;
-	void *traces[1024];
 	lt_error_data_t *d = lt_mem_alloc_object(sizeof (lt_error_data_t));
-	int size;
 	lt_bool_t allocated;
 
 	lt_return_val_if_fail (error != NULL, NULL);
@@ -117,13 +114,9 @@
 	d->message = lt_strdup_vprintf(message, ap);
 	va_end(ap);
 
-	size = backtrace(traces, 1024);
-	if (size > 0)
-		d->traces = backtrace_symbols(traces, size);
-	d->stack_size = size;
+	d->stack_size = 0;
 
 	lt_mem_add_ref(&d->parent, d->message, free);
-	lt_mem_add_ref(&d->parent, d->traces, free);
 
 	allocated = (*error)->data == NULL;
 	(*error)->data = lt_list_append((*error)->data, d, (lt_destroy_func_t)lt_mem_unref);
diff -r -u liblangtag-0.4.0.org/liblangtag/lt-ext-module.c liblangtag-0.4.0/liblangtag/lt-ext-module.c
--- misc/liblangtag-0.4.0.org/liblangtag/lt-ext-module.c	2012-11-06 09:15:59.000000000 -0600
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-ext-module.c	2012-11-06 09:30:31.000000000 -0600
@@ -399,7 +399,8 @@
 
 			if (len > suffix_len &&
 			    lt_strcmp0(&filename[prefix_len + len - suffix_len], "." LT_MODULE_SUFFIX) == 0) {
-				module = strndup(&filename[prefix_len], len - suffix_len);
+				module = malloc((len-suffix_len) + 1);
+				strncpy(module, &filename[prefix_len], len-suffix_len);
 				module[len - suffix_len] = 0;
 			}
 		}
diff -r -u liblangtag-0.4.0.org/liblangtag/lt-messages.c liblangtag-0.4.0/liblangtag/lt-messages.c
--- misc/liblangtag-0.4.0.org/liblangtag/lt-messages.c	2012-11-06 09:15:59.000000000 -0600
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-messages.c	2012-11-06 09:20:58.000000000 -0600
@@ -17,7 +17,6 @@
 #include "config.h"
 #endif
 
-#include <execinfo.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -98,27 +97,6 @@
 static void
 _lt_message_stacktrace(void)
 {
-	void *traces[1024];
-	char **strings;
-	int size, i;
-
-	size = backtrace(traces, 1024);
-	if (size > 0) {
-		strings = backtrace_symbols(traces, size);
-		lt_debug(LT_MSGCAT_TRACE, "Stacktrace:");
-		/*
-		 * XXX:
-		 * 0.. here.
-		 * 1.. _lt_message_default_handler
-		 * 2.. lt_message_vprintf
-		 * 3.. lt_message_printf
-		 * 4.. lt_* macros
-		 */
-		for (i = 4; i < size; i++) {
-			lt_debug(LT_MSGCAT_TRACE, "  %d. %s", i - 3, strings[i]);
-		}
-		free(strings);
-	}
 }
 
 static void
diff -r -u liblangtag-0.4.0.org/liblangtag/lt-utils.c liblangtag-0.4.0/liblangtag/lt-utils.c
--- misc/liblangtag-0.4.0.org/liblangtag/lt-utils.c	2012-11-06 09:15:59.000000000 -0600
+++ misc/build/liblangtag-0.4.0/liblangtag/lt-utils.c	2012-11-06 09:23:36.000000000 -0600
@@ -14,6 +14,7 @@
 #include "config.h"
 #endif
 
+#include <stdlib.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>