From ac9e1eac1632ae11e4ead6f76e7f9b3c17bf711d Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 8 Apr 2004 22:14:28 +0000
Subject: [PATCH] - start file choosers in home directory if $PWD is not
 defined - try to get $HOME on Windows too (not sure why I #ifdef'ed this)

---
 Common/Options.cpp | 4 +---
 Fltk/Callbacks.cpp | 5 +++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Common/Options.cpp b/Common/Options.cpp
index e3a6a1d256..e3ccab7620 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.140 2004-04-08 18:12:10 geuzaine Exp $
+// $Id: Options.cpp,v 1.141 2004-04-08 22:14:28 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -80,10 +80,8 @@ void Init_Options(int num)
   // Home directory
   if((tmp = getenv("GMSH_HOME")))
     strcpy(CTX.home_dir, tmp);
-#if !defined(WIN32)     // Some WinNT systems have bad HOME variables...
   else if((tmp = getenv("HOME")))
     strcpy(CTX.home_dir, tmp);
-#endif
   else if((tmp = getenv("TMP")))
     strcpy(CTX.home_dir, tmp);
   else if((tmp = getenv("TEMP")))
diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index e4e3f98f22..6d89268bda 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.212 2004-04-01 22:21:36 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.213 2004-04-08 22:14:28 geuzaine Exp $
 //
 // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
 //
@@ -97,7 +97,8 @@ int file_chooser(int multi, int create, const char *message,
   Fl_File_Chooser::all_files_label = "All files (*)";
 
   if(!fc) {
-    fc = new Fl_File_Chooser(".", pat, Fl_File_Chooser::SINGLE, message);
+    fc = new Fl_File_Chooser(getenv("PWD") ? "." : CTX.home_dir, pat, 
+			     Fl_File_Chooser::SINGLE, message);
     strncpy(oldfilter, pat, 1024);
   }
 
-- 
GitLab