diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 65a54e5cec..0f8389b951 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,9 @@ +2005-08-31 Jean-Marc Lasgouttes + + * filetools.C (MakeDisplayPath): fix bug when HOME is empty. + + * lstrings.C (subst): the string to be replaced should not be empty. + 2005-07-12 Jean-Marc Lasgouttes * package.C (get_default_user_support_dir): for windows and osx diff --git a/src/support/filetools.C b/src/support/filetools.C index 33f4f03051..48d75614a3 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -1324,7 +1324,7 @@ string const MakeDisplayPath(string const & path, unsigned int threshold) string const home(lyx::package().home_dir()); // replace /home/blah with ~/ - if (prefixIs(str, home)) + if (!home.empty() && prefixIs(str, home)) str = subst(str, home, "~"); if (str.length() <= threshold) diff --git a/src/support/lstrings.C b/src/support/lstrings.C index 75cbc7a949..c5544d8c4d 100644 --- a/src/support/lstrings.C +++ b/src/support/lstrings.C @@ -463,7 +463,7 @@ string const subst(string const & a, char oldchar, char newchar) string const subst(string const & a, char const * oldstr, string const & newstr) { - lyx::Assert(oldstr); + lyx::Assert(oldstr && oldstr[0]); string lstr(a); string::size_type i = 0; @@ -480,6 +480,8 @@ string const subst(string const & a, string const subst(string const & a, string const & oldstr, string const & newstr) { + lyx::Assert(!oldstr.empty()); + string lstr(a); string::size_type i = 0; string::size_type const olen = oldstr.length(); diff --git a/status.13x b/status.13x index 3acbf15d98..b52c686da4 100644 --- a/status.13x +++ b/status.13x @@ -44,9 +44,11 @@ What's new - Enable TeXFiles.sh to run when its path contains spaces. +- Fix crash when trying to display current directory and ${HOME} is empty. + * Configuration/Installation: -- compile without STL compatibilty support, since some systems do that +- compile without STL compatibility support, since some systems do that by default (Slackware, for ex.). [Qt only] - enable compilation of LyX on DragonFly BSD.