diff --git a/Common/Context.h b/Common/Context.h
index f8381d46c4daff159dc319bf0e72bc393f5a0cbe..213669b51698b5c6b6bca1ad6c4e3b6eda26ee55 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -39,7 +39,8 @@ public :
   char *display;              // forced display host:0.0 under X11 
   int  terminal;              // show we print to the terminal console?
   char *editor;               // text editor command (with included '%s')
-  char home_dir[NAME_STR_L];  // the home directory
+  char home_dir[NAME_STR_L], tmp_dir[NAME_STR_L];
+                              // the home and tmp directories
 
   int position[2];            // position of the menu window on the screen
   int gl_position[2];         // position of the graphic window on the screen
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 8ba08830017b65d73f0d53139db8441a6f8362de..2c04b8a4137e95ffacfe163257b56db49bf14541 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.20 2001-05-21 13:01:13 geuzaine Exp $
+// $Id: Options.cpp,v 1.21 2001-05-21 13:19:05 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -22,8 +22,11 @@ void Init_Options(int num){
   char *tmp;
 
   // Home directory
+#if !defined(WIN32) // Some WinNT systems have bad HOME variables...
   if((tmp = getenv("HOME")))      strcpy(CTX.home_dir, tmp);
-  else if((tmp = getenv("TMP")))  strcpy(CTX.home_dir, tmp);
+  else 
+#endif
+  if((tmp = getenv("TMP")))       strcpy(CTX.home_dir, tmp);
   else if((tmp = getenv("TEMP"))) strcpy(CTX.home_dir, tmp);
   else                            strcpy(CTX.home_dir, "");
   if(strlen(CTX.home_dir)){