Magellan Linux

Contents of /trunk/libast/patches/libast-0.6.1-config-warning.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (show annotations) (download)
Tue May 8 20:06:05 2007 UTC (17 years, 5 months ago) by niro
File size: 6797 byte(s)
-import

1 Grab fix from upstream CVS to address
2 http://bugs.gentoo.org/94479
3
4 ----------------------------------------------------------------------
5 Mon Mar 7 17:28:00 2005 Michael Jennings (mej)
6
7 Finally found and fixed that stupid "Config file is designed for a
8 newer version of FOO" bullshit warning.
9 ----------------------------------------------------------------------
10
11 Index: src/conf.c
12 ===================================================================
13 RCS file: /cvsroot/enlightenment/eterm/libast/src/conf.c,v
14 retrieving revision 1.25
15 retrieving revision 1.26
16 diff -u -r1.25 -r1.26
17 --- src/conf.c 21 Oct 2004 20:03:16 -0000 1.25
18 +++ src/conf.c 7 Mar 2005 22:29:07 -0000 1.26
19 @@ -827,10 +827,12 @@
20 /* Check version number against current application version. */
21 begin_ptr = SPIF_STR_STR(ver_str) + spif_str_index(ver_str, SPIF_CAST(char) '-') + 1;
22 end_ptr = SPIF_STR_STR(ver_str) + spif_str_index(ver_str, SPIF_CAST(char) '>');
23 + D_CONF(("Begin pointer is %10p (%s), end pointer is %10p (%s), length is %d, buffer size is %d\n",
24 + begin_ptr, begin_ptr, end_ptr, end_ptr, SPIF_CAST_C(int) (end_ptr - begin_ptr), sizeof(buff)));
25 if (SPIF_PTR_ISNULL(end_ptr)) {
26 spiftool_safe_strncpy(buff, begin_ptr, sizeof(buff));
27 } else {
28 - testlen = MAX(SPIF_CAST_C(int) sizeof(buff), SPIF_CAST_C(int) (end_ptr - begin_ptr));
29 + testlen = MIN(SPIF_CAST_C(int) sizeof(buff), SPIF_CAST_C(int) (end_ptr - begin_ptr + 1));
30 spiftool_safe_strncpy(buff, begin_ptr, testlen);
31 }
32 ver = spiftool_version_compare(buff, libast_program_version);
33 Index: src/strings.c
34 ===================================================================
35 RCS file: /cvsroot/enlightenment/eterm/libast/src/strings.c,v
36 retrieving revision 1.24
37 retrieving revision 1.25
38 diff -u -r1.24 -r1.25
39 --- src/strings.c 23 Jul 2004 21:38:39 -0000 1.24
40 +++ src/strings.c 7 Mar 2005 22:29:07 -0000 1.25
41 @@ -710,21 +710,24 @@
42 {
43 spif_char_t buff1[128], buff2[128];
44
45 + D_CONF(("Comparing version strings \"%s\" and \"%s\"\n", NONULL(v1), NONULL(v2)));
46 SPIF_COMP_CHECK_NULL(v1, v2);
47
48 for (; *v1 && *v2; ) {
49 + D_CONF((" -> Looking at \"%s\" and \"%s\"\n", v1, v2));
50 if (isalpha(*v1) && isalpha(*v2)) {
51 spif_charptr_t p1 = buff1, p2 = buff2;
52 spif_int8_t ival1 = 6, ival2 = 6;
53
54 /* Compare words. First, copy each word into buffers. */
55 - for (; isalpha(*v1); v1++, p1++) *p1 = *v1;
56 - for (; isalpha(*v2); v2++, p2++) *p2 = *v2;
57 + for (; *v1 && isalpha(*v1); v1++, p1++) *p1 = *v1;
58 + for (; *v2 && isalpha(*v2); v2++, p2++) *p2 = *v2;
59 *p1 = *p2 = 0;
60
61 /* Change the buffered strings to lowercase for easier comparison. */
62 spiftool_downcase_str(buff1);
63 spiftool_downcase_str(buff2);
64 + D_CONF((" -> Comparing as words \"%s\" vs. \"%s\"\n", buff1, buff2));
65
66 /* Some strings require special handling. */
67 if (!strcmp(SPIF_CHARPTR_C(buff1), "snap")) {
68 @@ -751,12 +754,14 @@
69 }
70 if (ival1 != ival2) {
71 /* If the values are different, compare them. */
72 + D_CONF((" -> %d\n", (int) SPIF_CMP_FROM_INT(ival1 - ival2)));
73 return SPIF_CMP_FROM_INT(ival1 - ival2);
74 } else if (ival1 == 6) {
75 int c;
76
77 /* Two arbitrary strings. Compare them too. */
78 if ((c = strcmp(SPIF_CHARPTR_C(buff1), SPIF_CHARPTR_C(buff2))) != 0) {
79 + D_CONF((" -> %d\n", (int) SPIF_CMP_FROM_INT(c)));
80 return SPIF_CMP_FROM_INT(c);
81 }
82 }
83 @@ -766,17 +771,19 @@
84 spif_cmp_t c;
85
86 /* Compare numbers. First, copy each number into buffers. */
87 - for (; isdigit(*v1); v1++, p1++) *p1 = *v1;
88 - for (; isdigit(*v2); v2++, p2++) *p2 = *v2;
89 + for (; *v1 && isdigit(*v1); v1++, p1++) *p1 = *v1;
90 + for (; *v2 && isdigit(*v2); v2++, p2++) *p2 = *v2;
91 *p1 = *p2 = 0;
92
93 /* Convert the strings into actual integers. */
94 ival1 = SPIF_CAST(int32) strtol(SPIF_CHARPTR_C(buff1), (char **) NULL, 10);
95 ival2 = SPIF_CAST(int32) strtol(SPIF_CHARPTR_C(buff2), (char **) NULL, 10);
96 + D_CONF((" -> Comparing as integers %d vs. %d\n", SPIF_CAST_C(int) ival1, SPIF_CAST_C(int) ival2));
97
98 /* Compare the integers and return if not equal. */
99 c = SPIF_CMP_FROM_INT(ival1 - ival2);
100 if (!SPIF_CMP_IS_EQUAL(c)) {
101 + D_CONF((" -> %d\n", (int) c));
102 return c;
103 }
104 } else if (!isalnum(*v1) && !isalnum(*v2)) {
105 @@ -784,15 +791,19 @@
106 spif_cmp_t c;
107
108 /* Compare non-alphanumeric strings. */
109 - for (; !isalnum(*v1); v1++, p1++) *p1 = *v1;
110 - for (; !isalnum(*v2); v2++, p2++) *p2 = *v2;
111 + for (; *v1 && !isalnum(*v1); v1++, p1++) *p1 = *v1;
112 + for (; *v2 && !isalnum(*v2); v2++, p2++) *p2 = *v2;
113 *p1 = *p2 = 0;
114
115 + D_CONF((" -> Comparing as non-alphanumeric strings \"%s\" vs. \"%s\"\n", buff1, buff2));
116 c = SPIF_CMP_FROM_INT(strcasecmp(SPIF_CHARPTR_C(buff1), SPIF_CHARPTR_C(buff2)));
117 if (!SPIF_CMP_IS_EQUAL(c)) {
118 + D_CONF((" -> %d\n", (int) c));
119 return c;
120 }
121 } else {
122 + D_CONF((" -> Comparing as alphanumeric strings \"%s\" vs. \"%s\"\n", buff1, buff2));
123 + D_CONF((" -> %d\n", (int) SPIF_CMP_FROM_INT(strcasecmp(SPIF_CHARPTR_C(buff1), SPIF_CHARPTR_C(buff2)))));
124 return SPIF_CMP_FROM_INT(strcasecmp(SPIF_CHARPTR_C(buff1), SPIF_CHARPTR_C(buff2)));
125 }
126 }
127 @@ -801,18 +812,23 @@
128 if (*v1) {
129 if (!BEG_STRCASECMP(SPIF_CHARPTR_C(v1), "snap") || !BEG_STRCASECMP(SPIF_CHARPTR_C(v1), "pre")
130 || !BEG_STRCASECMP(SPIF_CHARPTR_C(v1), "alpha") || !BEG_STRCASECMP(SPIF_CHARPTR_C(v1), "beta")) {
131 + D_CONF((" -> <\n"));
132 return SPIF_CMP_LESS;
133 } else {
134 + D_CONF((" -> >\n"));
135 return SPIF_CMP_GREATER;
136 }
137 } else if (*v2) {
138 if (!BEG_STRCASECMP(SPIF_CHARPTR_C(v2), "snap") || !BEG_STRCASECMP(SPIF_CHARPTR_C(v2), "pre")
139 || !BEG_STRCASECMP(SPIF_CHARPTR_C(v2), "alpha") || !BEG_STRCASECMP(SPIF_CHARPTR_C(v2), "beta")) {
140 + D_CONF((" -> >\n"));
141 return SPIF_CMP_GREATER;
142 } else {
143 + D_CONF((" -> <\n"));
144 return SPIF_CMP_LESS;
145 }
146 }
147 + D_CONF((" -> ==\n"));
148 return SPIF_CMP_EQUAL;
149 }
150