mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-05 01:55:52 +00:00
net-im/jabber: unbreak with libc++ 3.9
log.cc:89:8: error: assigning to 'char *' from incompatible type 'const char *' pos = strchr(zone,'.'); ^~~~~~~~~~~~~~~~ xmlnode.cc:913:21: error: assigning to 'char *' from incompatible type 'const char *' start_predicate = strchr(path, '['); ^ ~~~~~~~~~~~~~~~~~ xmlnode.cc:914:15: error: assigning to 'char *' from incompatible type 'const char *' next_step = strchr(path, '/'); ^ ~~~~~~~~~~~~~~~~~ xmlnode.cc:1836:27: error: read-only variable is not assignable strchr(lang, '-')[0] = 0; ~~~~~~~~~~~~~~~~~~~~ ^ Reported by: pkg-fallout
This commit is contained in:
parent
6e4b3d2141
commit
9f60a6df34
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=433022
@ -3,7 +3,7 @@
|
||||
|
||||
PORTNAME= jabber
|
||||
PORTVERSION= 1.6.1.1
|
||||
PORTREVISION= 19
|
||||
PORTREVISION= 20
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= net-im ipv6
|
||||
MASTER_SITES= http://download.jabberd.org/jabberd14/%SUBDIR%/
|
||||
|
37
net-im/jabber/files/patch-jabberd_lib_xmlnode.cc
Normal file
37
net-im/jabber/files/patch-jabberd_lib_xmlnode.cc
Normal file
@ -0,0 +1,37 @@
|
||||
--- jabberd/lib/xmlnode.cc.orig 2007-04-07 19:43:18 UTC
|
||||
+++ jabberd/lib/xmlnode.cc
|
||||
@@ -879,9 +879,9 @@ xmlnode xmlnode_get_tag(xmlnode parent,
|
||||
xmlnode_list_item xmlnode_get_tags(xmlnode context_node, const char *path, xht namespaces, pool p) {
|
||||
char *this_step = NULL;
|
||||
const char *ns_iri = NULL;
|
||||
- char *next_step = NULL;
|
||||
- char *start_predicate = NULL;
|
||||
- char *end_predicate = NULL;
|
||||
+ const char *next_step = NULL;
|
||||
+ const char *start_predicate = NULL;
|
||||
+ const char *end_predicate = NULL;
|
||||
char *predicate = NULL;
|
||||
char *end_prefix = NULL;
|
||||
int axis = 0; /* 0 = child, 1 = parent, 2 = attribute */
|
||||
@@ -1830,13 +1830,14 @@ xmlnode xmlnode_select_by_lang(xmlnode_l
|
||||
}
|
||||
|
||||
/* if language has a geographical veriant, get the language as well */
|
||||
- if (lang != NULL && strchr(lang, '-') != NULL) {
|
||||
- snprintf(general_lang, sizeof(general_lang), "%s", lang);
|
||||
- if (strchr(lang, '-') != NULL) {
|
||||
- strchr(lang, '-')[0] = 0;
|
||||
- } else {
|
||||
- general_lang[0] = 0;
|
||||
- }
|
||||
+ if (lang != NULL) {
|
||||
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
+ size_t len = sizeof(general_lang);
|
||||
+ const char *pos;
|
||||
+ if ((pos = strchr(lang, '-')))
|
||||
+ len = MIN(len, pos - lang + 1);
|
||||
+
|
||||
+ snprintf(general_lang, len, "%s", lang);
|
||||
}
|
||||
|
||||
/* iterate the nodes */
|
32
net-im/jabber/files/patch-jabberd_log.cc
Normal file
32
net-im/jabber/files/patch-jabberd_log.cc
Normal file
@ -0,0 +1,32 @@
|
||||
--- jabberd/log.cc.orig 2007-07-20 13:56:59 UTC
|
||||
+++ jabberd/log.cc
|
||||
@@ -83,21 +83,22 @@ static char *debug_log_timestamp(void) {
|
||||
* @return 1 if it should be logged, 0 if not
|
||||
*/
|
||||
static inline int _debug_log_zonefilter(char const* zone) {
|
||||
- char *pos, c = '\0';
|
||||
+ const char *pos;
|
||||
+ char *tmp;
|
||||
+ int ret = 1;
|
||||
if(zone != NULL && debug__zones != NULL)
|
||||
{
|
||||
pos = strchr(zone,'.');
|
||||
if(pos != NULL)
|
||||
{
|
||||
- c = *pos;
|
||||
- *pos = '\0'; /* chop */
|
||||
+ tmp = strndup(zone, pos - zone);
|
||||
}
|
||||
- if(xhash_get(debug__zones,zone) == NULL)
|
||||
- return 0;
|
||||
+ if(xhash_get(debug__zones, (pos ? tmp : zone)) == NULL)
|
||||
+ ret = 0;
|
||||
if(pos != NULL)
|
||||
- *pos = c; /* restore */
|
||||
+ free(tmp);
|
||||
}
|
||||
- return 1;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/**
|
Loading…
Reference in New Issue
Block a user