Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2017 12:30:08 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r433022 - in head/net-im/jabber: . files
Message-ID:  <201702011230.v11CU83Z064719@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Feb  1 12:30:08 2017
New Revision: 433022
URL: https://svnweb.freebsd.org/changeset/ports/433022

Log:
  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

Added:
  head/net-im/jabber/files/patch-jabberd_lib_xmlnode.cc   (contents, props changed)
  head/net-im/jabber/files/patch-jabberd_log.cc   (contents, props changed)
Modified:
  head/net-im/jabber/Makefile   (contents, props changed)

Modified: head/net-im/jabber/Makefile
==============================================================================
--- head/net-im/jabber/Makefile	Wed Feb  1 12:29:56 2017	(r433021)
+++ head/net-im/jabber/Makefile	Wed Feb  1 12:30:08 2017	(r433022)
@@ -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%/

Added: head/net-im/jabber/files/patch-jabberd_lib_xmlnode.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-im/jabber/files/patch-jabberd_lib_xmlnode.cc	Wed Feb  1 12:30:08 2017	(r433022)
@@ -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 */

Added: head/net-im/jabber/files/patch-jabberd_log.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-im/jabber/files/patch-jabberd_log.cc	Wed Feb  1 12:30:08 2017	(r433022)
@@ -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;
+ }
+ 
+ /**



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702011230.v11CU83Z064719>