From 6517abd9bd07dfc5aedc795f6019228de9a44343 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 1 Jan 2005 02:14:31 +0000
Subject: [PATCH] The TCP patch broke UNIX solckets on Winwows (since Windows
 paths can contain a colon)

---
 utils/solvers/GmshClient.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/utils/solvers/GmshClient.c b/utils/solvers/GmshClient.c
index 748a404ea8..4a1b8c519a 100644
--- a/utils/solvers/GmshClient.c
+++ b/utils/solvers/GmshClient.c
@@ -1,4 +1,4 @@
-/* $Id: GmshClient.c,v 1.8 2004-12-06 07:59:59 geuzaine Exp $ */
+/* $Id: GmshClient.c,v 1.9 2005-01-01 02:14:31 geuzaine Exp $ */
 /*
  * Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
  *
@@ -93,10 +93,15 @@ int Gmsh_Connect(char *sockname)
      server before we attempt to connect to it... */
   Socket_Idle(0.1);
 
-  if(!(port = strstr(sockname, ":"))){ /* UNIX socket */
+  if(strstr(sockname, "/") || strstr(sockname, "\\") || !strstr(sockname, ":")){
+    /* UNIX socket (testing ":" is not enough with Windows paths) */
     portno = -1;
   }
-  else{ /* INET socket */
+  else{
+    /* INET socket */
+    port = strstr(sockname, ":");
+    if(!port)
+      return -1; /* Error: Couldn't create socket */
     portno = atoi(port+1);
     remotelen = strlen(sockname) - strlen(port);
     if(remotelen > 0)
-- 
GitLab