From 2d7ab063eb5144f20e7916b8902d40b45709c101 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 23 Nov 2003 03:24:43 +0000 Subject: [PATCH] check if the file exists before trying to merge it --- Fltk/Callbacks.cpp | 11 +++++++++-- Makefile | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 414a95f3e1..a611a41f2e 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.186 2003-11-21 07:56:29 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.187 2003-11-23 03:24:43 geuzaine Exp $ // // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle // @@ -2712,10 +2712,17 @@ void view_reload_cb(CALLBACK_ARGS) Post_View *v = (Post_View *) List_Pointer(CTX.post.list, (long int)data); strcpy(filename, v->FileName); + + FILE *fp; + if(!(fp = fopen(filename, "r"))){ + Msg(GERROR, "Unable to open file '%s'", filename); + return; + } + CopyViewOptions(v, &tmp); + FreeView(v); CTX.post.force_num = v->Num; - FreeView(v); MergeProblem(filename); CTX.post.force_num = 0; diff --git a/Makefile b/Makefile index de7752cf70..9547ea00f5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.306 2003-11-16 16:49:37 geuzaine Exp $ +# $Id: Makefile,v 1.307 2003-11-23 03:24:43 geuzaine Exp $ # # Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle # @@ -23,7 +23,7 @@ include variables GMSH_MAJOR_VERSION = 1 GMSH_MINOR_VERSION = 47 -GMSH_PATCH_VERSION = 1 +GMSH_PATCH_VERSION = 2 GMSH_SHORT_LICENSE = "GNU General Public License" @@ -106,7 +106,7 @@ doc-info: purge: rm -f `find . -name "*~" -o -name "*~~" -o -name ".gmsh-errors"\ - -o -name "\#*" -o -name "gmon.out"` + -o -name "\#*" -o -name "gmon.out" -o -name ".gdb_history"` clean: for i in doc lib ${GMSH_DIRS}; do (cd $$i && ${MAKE} clean); done -- GitLab