From a3a55117e1b672e178a8034e6f3452d0b528a5cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 2 Nov 1999 21:19:58 +0000 Subject: [PATCH] new version of the SpaceLess function git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@278 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 4 ++++ src/lyx_cb.C | 4 ++-- src/support/filetools.C | 13 +++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a16d19f6e..3d697972ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1999-11-02 Lars Gullik Bjønnes + * src/support/filetools.C (SpaceLess): new version of the + SpaceLess functions. What problems does this one give? Please + report. + * images/banner_bw.xbm: made the arrays unsigned char * 1999-11-02 Jean-Marc Lasgouttes diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 7adbc5328f..f3443ab3e5 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -561,7 +561,7 @@ int MakeDVIOutput(Buffer *buffer) /* wait == true means wait for termination */ // The bool should be placed last on the argument line. (Lgb) // Returns false if we fail. -bool RunScript(Buffer *buffer, bool wait, +bool RunScript(Buffer * buffer, bool wait, string const & command, string const & orgname = string(), bool need_shell=true) { @@ -828,7 +828,7 @@ bool MenuPreview(Buffer *buffer) } -void MenuMakeLaTeX(Buffer *buffer) +void MenuMakeLaTeX(Buffer * buffer) { if (buffer->text) { // Get LaTeX-Filename diff --git a/src/support/filetools.C b/src/support/filetools.C index f54f05d4b1..0ffc353683 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -74,14 +74,15 @@ string SpaceLess(string const & file) for (string::size_type i = 0; i < name.length(); ++i) { name[i] &= 0x7f; // set 8th bit to 0 - if (!isalnum(name[i]) && name[i] != '.') - name[i] = '_'; + if (!isgraph(name[i])) name[i] = '_'; // get rid of cntrl chars + }; + // ok so we scan through the string twice, but who cares. + string change("/"); + string::size_type pos = 0; + while ((pos = name.find_first_of(change, pos)) != string::npos) { + name[pos] = '-'; } string temp = AddName(path, name); - // Replace spaces with underscores, also in directory - // No!!! I checked it that it is not necessary. - // temp = subst(temp, ' ', '_'); - return temp; } -- 2.39.2