mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-05 17:09:56 +00:00
fix crash when ${HOME} is empty
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@10420 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dc87093629
commit
cbdc09aa68
@ -1,3 +1,9 @@
|
|||||||
|
2005-08-31 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
|
* 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 <lasgouttes@lyx.org>
|
2005-07-12 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
* package.C (get_default_user_support_dir): for windows and osx
|
* package.C (get_default_user_support_dir): for windows and osx
|
||||||
|
@ -1324,7 +1324,7 @@ string const MakeDisplayPath(string const & path, unsigned int threshold)
|
|||||||
string const home(lyx::package().home_dir());
|
string const home(lyx::package().home_dir());
|
||||||
|
|
||||||
// replace /home/blah with ~/
|
// replace /home/blah with ~/
|
||||||
if (prefixIs(str, home))
|
if (!home.empty() && prefixIs(str, home))
|
||||||
str = subst(str, home, "~");
|
str = subst(str, home, "~");
|
||||||
|
|
||||||
if (str.length() <= threshold)
|
if (str.length() <= threshold)
|
||||||
|
@ -463,7 +463,7 @@ string const subst(string const & a, char oldchar, char newchar)
|
|||||||
string const subst(string const & a,
|
string const subst(string const & a,
|
||||||
char const * oldstr, string const & newstr)
|
char const * oldstr, string const & newstr)
|
||||||
{
|
{
|
||||||
lyx::Assert(oldstr);
|
lyx::Assert(oldstr && oldstr[0]);
|
||||||
|
|
||||||
string lstr(a);
|
string lstr(a);
|
||||||
string::size_type i = 0;
|
string::size_type i = 0;
|
||||||
@ -480,6 +480,8 @@ string const subst(string const & a,
|
|||||||
string const subst(string const & a,
|
string const subst(string const & a,
|
||||||
string const & oldstr, string const & newstr)
|
string const & oldstr, string const & newstr)
|
||||||
{
|
{
|
||||||
|
lyx::Assert(!oldstr.empty());
|
||||||
|
|
||||||
string lstr(a);
|
string lstr(a);
|
||||||
string::size_type i = 0;
|
string::size_type i = 0;
|
||||||
string::size_type const olen = oldstr.length();
|
string::size_type const olen = oldstr.length();
|
||||||
|
@ -44,9 +44,11 @@ What's new
|
|||||||
|
|
||||||
- Enable TeXFiles.sh to run when its path contains spaces.
|
- Enable TeXFiles.sh to run when its path contains spaces.
|
||||||
|
|
||||||
|
- Fix crash when trying to display current directory and ${HOME} is empty.
|
||||||
|
|
||||||
* Configuration/Installation:
|
* 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]
|
by default (Slackware, for ex.). [Qt only]
|
||||||
|
|
||||||
- enable compilation of LyX on DragonFly BSD.
|
- enable compilation of LyX on DragonFly BSD.
|
||||||
|
Loading…
Reference in New Issue
Block a user