Repository: lucy Updated Branches: refs/heads/master 61d45291a -> 25759e097
Adjust for Str_Swap_Chars removal Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/aa350716 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/aa350716 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/aa350716 Branch: refs/heads/master Commit: aa350716b27d37b1aff166f11006465dd3a93d39 Parents: 8be7674 Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Thu Oct 22 16:40:07 2015 +0200 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Thu Oct 22 16:47:06 2015 +0200 ---------------------------------------------------------------------- core/Lucy/Store/FSFolder.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/aa350716/core/Lucy/Store/FSFolder.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c index 40c17b8..1570bca 100644 --- a/core/Lucy/Store/FSFolder.c +++ b/core/Lucy/Store/FSFolder.c @@ -39,6 +39,7 @@ #include <direct.h> #endif +#include "Clownfish/CharBuf.h" #include "Lucy/Store/FSFolder.h" #include "Lucy/Store/CompoundFileReader.h" #include "Lucy/Store/CompoundFileWriter.h" @@ -276,7 +277,19 @@ S_fullpath(FSFolder *self, String *path) { String *fullpath = Str_newf("%o%s%o", ivars->path, CHY_DIR_SEP, path); String *retval; if (CHY_DIR_SEP[0] != '/') { - retval = Str_Swap_Chars(fullpath, '/', CHY_DIR_SEP[0]); + // Replace '/' with CHY_DIR_SEP. + StringIterator *iter = Str_Top(fullpath); + CharBuf *buf = CB_new(Str_Get_Size(fullpath)); + int32_t cp; + + while (STRITER_DONE != (cp = StrIter_Next(iter))) { + if (cp == '/') { cp = CHY_DIR_SEP[0]; } + CB_Cat_Char(buf, cp); + } + + retval = CB_Yield_String(buf); + DECREF(buf); + DECREF(iter); DECREF(fullpath); } else {