]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - test/ippfind.c
The ippfind and ipptool programs now correctly match hostnames with trailing
[thirdparty/cups.git] / test / ippfind.c
index 4ee52c345c7af40100b0290b7990f19e5aad0eaf..bf379f18580aff1e0455d7cf8d027ea3263a8858 100644 (file)
@@ -5,7 +5,7 @@
  * commands such as IPP and Bonjour conformance tests.  This tool is
  * inspired by the UNIX "find" command, thus its name.
  *
- * Copyright 2008-2014 by Apple Inc.
+ * Copyright 2008-2015 by Apple Inc.
  *
  * These coded instructions, statements, and computer programs are the
  * property of Apple Inc. and are protected by Federal copyright
@@ -2564,6 +2564,10 @@ resolve_callback(
   service->host        = strdup(hostTarget);
   service->port        = ntohs(port);
 
+  value = service->host + strlen(service->host) - 1;
+  if (value >= service->host && *value == '.')
+    *value = '\0';
+
  /*
   * Loop through the TXT key/value pairs and add them to an array...
   */
@@ -2635,6 +2639,10 @@ resolve_callback(
   service->host        = strdup(hostTarget);
   service->port        = port;
 
+  value = service->host + strlen(service->host) - 1;
+  if (value >= service->host && *value == '.')
+    *value = '\0';
+
  /*
   * Loop through the TXT key/value pairs and add them to an array...
   */