From: Lars Gullik Bjønnes Date: Wed, 27 Nov 2002 14:55:00 +0000 (+0000) Subject: fix ugly hack X-Git-Tag: 1.6.10~17881 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d0ba17263c383d67d25bb895f144856893cc3fdf;p=features.git fix ugly hack git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5733 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/ChangeLog b/src/support/ChangeLog index d376e2589c..c23dce4c64 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,7 @@ +2002-11-27 Lars Gullik Bjønnes + + * filetools.C (DirList): remove all ugly hacks and do it nice + 2002-11-13 Jean-Marc Lasgouttes * lyxsum.C: an ugly hack to compile with non-gnu linkers diff --git a/src/support/filetools.C b/src/support/filetools.C index 4cb71a7d80..e2602bd759 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -211,9 +211,11 @@ string const FileOpenSearch(string const & path, string const & name, vector const DirList(string const & dir, string const & ext) { // This is a non-error checking C/system implementation - string extension(ext); - if (!extension.empty() && extension[0] != '.') - extension.insert(string::size_type(0), 1, '.'); + string extension; + if (!ext.empty() && ext[0] != '.') + extension += '.'; + extension += ext; + vector dirlist; DIR * dirp = ::opendir(dir.c_str()); if (!dirp) {