Enable LyX to start up if the user support dir does not exists (protect 
all calls to fs::is_directory with a call to fs::exists).

Enable fs_extras.C to compile on a Windows box.

Committing now...
-- 
Angus
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2107
diff -u -p -r1.2107 ChangeLog
--- src/ChangeLog	31 Jan 2005 19:57:01 -0000	1.2107
+++ src/ChangeLog	1 Feb 2005 16:34:17 -0000
@@ -1,3 +1,8 @@
+2005-02-01  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* lyx_main.C (init, queryUserLyXDir): use fs::exists() before
+	calling fs::is_directory().
+
 2005-01-31  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* lyx_main.C (priv_exec): specify explicitly the relative location
Index: src/lyx_main.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.199
diff -u -p -r1.199 lyx_main.C
--- src/lyx_main.C	31 Jan 2005 19:57:02 -0000	1.199
+++ src/lyx_main.C	1 Feb 2005 16:34:20 -0000
@@ -484,7 +484,8 @@ void LyX::init(bool gui)
 	if (reconfigure)
 		reconfigureUserLyXDir();
 
-	if (fs::is_directory(lyxrc.document_path))
+	if (fs::exists(lyxrc.document_path) &&
+	    fs::is_directory(lyxrc.document_path))
 		package().document_dir() = lyxrc.document_path;
 
 	package().temp_dir() = createLyXTmpDir(lyxrc.tempdir_path);
@@ -612,7 +613,8 @@ bool LyX::queryUserLyXDir(bool explicit_
 	bool reconfigure = false;
 
 	// Does user directory exist?
-	if (fs::is_directory(package().user_support())) {
+	if (fs::exists(package().user_support()) &&
+	    fs::is_directory(package().user_support())) {
 		first_start = false;
 		string const configure_script =
 			AddName(package().system_support(), "configure");
Index: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.975
diff -u -p -r1.975 ChangeLog
--- src/frontends/xforms/ChangeLog	31 Jan 2005 10:42:22 -0000	1.975
+++ src/frontends/xforms/ChangeLog	1 Feb 2005 16:34:55 -0000
@@ -1,3 +1,8 @@
+2005-02-01  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* FormFiledialog.C (Reread): use fs::exists() before
+	calling fs::is_directory().
+
 2005-01-31  Lars Gullik Bjonnes  <[EMAIL PROTECTED]>
 
 	* xforms_helpers.C: rewrite to use boost.filesystem
Index: src/frontends/xforms/FormFiledialog.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormFiledialog.C,v
retrieving revision 1.66
diff -u -p -r1.66 FormFiledialog.C
--- src/frontends/xforms/FormFiledialog.C	31 Jan 2005 10:42:22 -0000	1.66
+++ src/frontends/xforms/FormFiledialog.C	1 Feb 2005 16:35:00 -0000
@@ -184,7 +184,7 @@ void FileDialog::Private::Reread()
 		if (!mask_.empty() && mask_[0] != '.' && fname[0] == '.')
 			continue;
 
-		bool const isDir = fs::is_directory(*beg);
+		bool const isDir = fs::exists(*beg) && fs::is_directory(*beg);
 
 		// filters files according to pattern and type
 			typedef vector<string>::const_iterator viterator;
Index: src/support/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/ChangeLog,v
retrieving revision 1.321
diff -u -p -r1.321 ChangeLog
--- src/support/ChangeLog	31 Jan 2005 19:57:03 -0000	1.321
+++ src/support/ChangeLog	1 Feb 2005 16:35:02 -0000
@@ -1,3 +1,7 @@
+2005-02-01  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* fs_extras.C: #include <windows.h>
+
 2005-01-31  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* package.[Ch] (init_package, c-tor): define and use an enum to
Index: src/support/filetools.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/filetools.C,v
retrieving revision 1.204
diff -u -p -r1.204 filetools.C
--- src/support/filetools.C	31 Jan 2005 10:42:23 -0000	1.204
+++ src/support/filetools.C	1 Feb 2005 16:35:03 -0000
@@ -106,7 +106,6 @@ string const MakeLatexName(string const 
 }
 
 
-// Substitutes spaces with underscores in filename (and path)
 string const QuoteName(string const & name)
 {
 	return (os::shell() == os::UNIX) ?
@@ -307,8 +306,8 @@ string const LibScriptSearch(string cons
 	string::size_type const pos1 = command.find(token_scriptpath);
 	if (pos1 == string::npos)
 		return command;
-	// Find the end of the "$$s/some_script" word within command.
-	// Assumes that the script name does not contain spaces.
+	// Find the end of the "$$s/some_subdir/some_script" word within
+	// command. Assumes that the script name does not contain spaces.
 	string::size_type const start_script = pos1 + 4;
 	string::size_type const pos2 = command.find(' ', start_script);
 	string::size_type const size_script = pos2 == string::npos?
Index: src/support/fs_extras.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/fs_extras.C,v
retrieving revision 1.2
diff -u -p -r1.2 fs_extras.C
--- src/support/fs_extras.C	31 Jan 2005 19:31:11 -0000	1.2
+++ src/support/fs_extras.C	1 Feb 2005 16:35:03 -0000
@@ -22,6 +22,11 @@
 #   endif
 # endif
 
+#if defined (BOOST_WINDOWS)
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
 namespace fs = boost::filesystem;
 
 namespace boost {

Reply via email to