>>OK, Let's get these in first. I just commited a new function
>>CleanupPath() in cvs which does the following:
>>
>>===================================================================
>>RCS file: /usr/local/lyxsrc/cvsroot/lyx-1_0_x/src/filetools.C,v
>>retrieving revision 1.5
>>retrieving revision 1.6
>>diff -u -r1.5 -r1.6
>>--- filetools.C 1999/07/07 10:04:46 1.5
>>+++ filetools.C 1999/07/26 16:46:24 1.6
>>@@ -666,6 +666,18 @@
>> return TempBase;
>> }
>>
>>+LString CleanupPath(LString const &path)
>>+{
>>+#ifdef __EMX__ /* SMiyata: This should fix searchpath bug. */
>>+ LString temppath(path);
>>+ temppath.subst('\\', '/');
>>+ temppath.lowercase();
>>+ return tempath;
>>+#else // On unix, nothing to do
>>+ return path;
>>+#endif
>>+}
>>+
>>
>>---------------
>>
>>Could you use that in your patches, you can do either
>> name = CleanupPath(name);
>>or
>> LString temp = CleanupPath(name);
>>
>>I did not try it, but it should obviously work, and the overhead for
>>unices, while non-null, is not important.
>>
>>Hopefully, this should allow you to remove *all* the EMX ifdefs which
>>are related to this. Also, the part where you ifdef a large chunk
>>should be avoided. Just use a temp variable in all cases.
>>
The remaining problem is locale support.
Using C function calls of a gnuish OS-support library wrapped into C++:
LString CleanupPath(char *inpath)
{
#ifdef __EMX__
extern "C" {
UnixFileName(inpath);
ToLower(inpath);
}
#else
#ifdef _DOLPHIN32
...
#else
#endif
#ifdef _FISH64
...
#else
#endif
#ifdef _CRAB128
...
#else
#endif
// On unix, nothing to do
#endif
LString outpath(inpath);
return outpath;
}
Similar for lowercase() method, etc.
I've no idea, if this is correct and clean. I'm still learning and all
that is a bit complicated. Probably LString documentation can be
enhanced, so that you can avoid answering over and over all the same
questions by ignorants like me.
And: Please take your time to think of a clean solution. I'm very
patient and never expect a fast answer :)
Regards,
Arnd