--- ..\..\Git-latest\tests\libtest\chkhostname.c	Mon Jan 28 16:48:44 2013
+++ chkhostname.c	Fri Feb 08 12:07:22 2013
@@ -19,8 +19,8 @@
  * KIND, either express or implied.
  *
  ***************************************************************************/
-#include "curl_setup.h"
 
+#include "test.h"
 #include "curl_gethostname.h"
 
 #define HOSTNAME_MAX 1024
@@ -28,20 +28,31 @@
 int main(int argc, char *argv[])
 {
   char buff[HOSTNAME_MAX];
+  int  rc;
+
   if (argc != 2) {
     printf("Usage: %s EXPECTED_HOSTNAME\n", argv[0]);
     return 1;
   }
 
+  if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
+    printf("curl_global_init() failed\n");
+    return 1;
+  }
+
   if (Curl_gethostname(buff, HOSTNAME_MAX)) {
     printf("Curl_gethostname() failed\n");
     return 1;
   }
 
-  /* compare the name returned by Curl_gethostname() with the expected one */
-  if(strncmp(buff, argv[1], HOSTNAME_MAX)) {
+  rc = 0;  /* assume success */
+
+  /* compare the name (case insensitively) returned by Curl_gethostname()
+   * with the expected one */
+  if(!curl_strnequal(buff, argv[1], HOSTNAME_MAX)) {
     printf("got unexpected host name back, LD_PRELOAD failed\n");
-    return 1;
+    rc = 1;
   }
-  return 0;
+  curl_global_cleanup();
+  return rc;
 }

