diff --git a/Common/Context.h b/Common/Context.h
index 45f2ccf774dc80488dcbff158ba440f986963324..f02ae739aa25e1a7b690ea8f9262db43a000755f 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -146,7 +146,7 @@ public :
 	cut_planec * z + cut_planed; 
       return val;
     }
-    int oldxtrude, oldxtrude_recombine;
+    int oldxtrude, oldxtrude_recombine, check_duplicates;
   } mesh;
 
   // post processing options 
diff --git a/Common/GetOptions.cpp b/Common/GetOptions.cpp
index 92dcf5f87b175efc6d62c9fa65cac00d66a84458..3e9b5644fa46f71335290bff35e8e2ab6918bd0e 100644
--- a/Common/GetOptions.cpp
+++ b/Common/GetOptions.cpp
@@ -1,4 +1,4 @@
-// $Id: GetOptions.cpp,v 1.30 2001-07-31 08:10:33 geuzaine Exp $
+// $Id: GetOptions.cpp,v 1.31 2001-08-02 19:11:40 geuzaine Exp $
 
 #include <unistd.h>
 #include "Gmsh.h"
@@ -147,6 +147,9 @@ void Get_Options (int argc, char *argv[], int *nbfiles) {
       else if(!strcmp(argv[i]+1, "recombine")){ //old extrusion mesh generator
         CTX.mesh.oldxtrude_recombine = 1; i++;
       }
+      else if(!strcmp(argv[i]+1, "dupli")){
+        CTX.mesh.check_duplicates = 1; i++;
+      }
       else if(!strcmp(argv[i]+1, "histogram")){ 
         CTX.mesh.histogram = 1; i++;
       }
diff --git a/Common/Options.cpp b/Common/Options.cpp
index c11ef940cb0930479234e8548e27c4f5f69eecdc..1b80f7c6fca4b9b2d1100aca9670f9d05ba65f10 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.36 2001-07-31 22:20:05 geuzaine Exp $
+// $Id: Options.cpp,v 1.37 2001-08-02 19:11:40 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -94,6 +94,7 @@ void Init_Options(int num){
   CTX.threads_lock = 0 ; //very primitive locking during mesh generation
   CTX.mesh.histogram = 0 ;
   CTX.mesh.oldxtrude = CTX.mesh.oldxtrude_recombine = 0; //old extrusion mesh generator
+  CTX.mesh.check_duplicates = 0; //check for duplicate nodes in Read_Mesh
 
   // For motif versions only:
   CTX.overlay = 1 ;
diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp
index e441dd80c104e16df1dfa47906c0603e86b262b3..04e517b779a0df53a214e480476aed218d9e83dc 100644
--- a/Mesh/Read_Mesh.cpp
+++ b/Mesh/Read_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Read_Mesh.cpp,v 1.21 2001-08-02 08:04:40 geuzaine Exp $
+// $Id: Read_Mesh.cpp,v 1.22 2001-08-02 19:11:40 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "Geo.h"
@@ -6,6 +6,9 @@
 #include "3D_Mesh.h"
 #include "Create.h"
 #include "MinMax.h"
+#include "Context.h"
+
+extern Context_T CTX;
 
 /* ------------------------------------------------------------------------ */
 /*  M S H    F O R M A T                                                    */
@@ -48,6 +51,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){
   Curve   C , *c , **cc;
   Surface S , *s , **ss;
   Volume  V , *v , **vv;
+  Tree_T *Duplis ;
   
   while (1) {
     do { 
@@ -78,21 +82,17 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){
       fscanf(File_GEO, "%d", &Nbr_Nodes) ;
       Msg(INFO, "%d Nodes", Nbr_Nodes);
       
-//#define SEARCH_DUPLICATES
-#ifdef SEARCH_DUPLICATES
-    Tree_T *Duplis = Tree_Create (sizeof (Vertex *), comparePosition);
-#endif
+      if(CTX.mesh.check_duplicates)
+	Duplis = Tree_Create (sizeof (Vertex *), comparePosition);
       for (i_Node = 0 ; i_Node < Nbr_Nodes ; i_Node++) {
         fscanf(File_GEO, "%d %lf %lf %lf", &Num, &x, &y, &z) ;
         vert = Create_Vertex (Num, x, y, z, 1.0 ,0.0);
         Tree_Replace(M->Vertices, &vert);
-#ifdef SEARCH_DUPLICATES
-        if(Tree_Replace(Duplis, &vert)) Msg(WARNING, "Node %g %g %g already exists");
-#endif
+	if(CTX.mesh.check_duplicates)
+	  if(Tree_Replace(Duplis, &vert)) Msg(WARNING, "Node %g %g %g already exists");
       }
-#ifdef SEARCH_DUPLICATES
-    Tree_Delete(Duplis);
-#endif
+      if(CTX.mesh.check_duplicates)
+	Tree_Delete(Duplis);
     }
     
     /* ELEMENTS */