From bd745ccd1e6da0253cbf3a717025744ad5c9aa33 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 25 May 2004 04:42:02 +0000
Subject: [PATCH] fix test in copy_mesh(surf, surf)

---
 Mesh/3D_Extrude.cpp | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/Mesh/3D_Extrude.cpp b/Mesh/3D_Extrude.cpp
index e3bda71aa8..b1a8310bc1 100644
--- a/Mesh/3D_Extrude.cpp
+++ b/Mesh/3D_Extrude.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Extrude.cpp,v 1.77 2004-05-25 04:10:04 geuzaine Exp $
+// $Id: 3D_Extrude.cpp,v 1.78 2004-05-25 04:42:02 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -919,14 +919,21 @@ void copy_mesh(Surface * from, Surface * to)
   Vertex **vexist, *newv[4];
 
   int nbs = Tree_Nbr(to->Simplexes);
-  int nbq = Tree_Nbr(to->Quadrangles);
-  if((nbs && nbs != Tree_Nbr(from->Simplexes)) ||
-     (nbq && nbq != Tree_Nbr(from->Quadrangles))){
-    Msg(GERROR, "Incompatible extrusion of surface %d into surface %d",
-	from->Num, to->Num);
+  if(nbs){
+    if(nbs != Tree_Nbr(from->Simplexes))
+      Msg(GERROR, "Incompatible extrusion of surface %d into surface %d",
+	  from->Num, to->Num);
     return;
   }
 
+  int nbq = Tree_Nbr(to->Quadrangles);
+  if(nbq){
+    if(nbq != Tree_Nbr(from->Quadrangles))
+      Msg(GERROR, "Incompatible extrusion of surface %d into surface %d",
+	  from->Num, to->Num);
+    return;
+  }
+  
   // triangles
   list = Tree2List(from->Simplexes);
   for(int i = 0; i < List_Nbr(list); i++) {
-- 
GitLab