lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Martin Spernau wrote:


as we noted some time ago, the LuaCheia code has had this functionality. The code is still there, but currently not used (as it is pending to be made into a module)

I spotted a minor bug in the code above:

#define LC_ISPATHSEP(C) (C=="/" ? 1 : 0 )
should probably be C=='/' or strcmp( C, "/" )!=0

And the same for
#define LC_ISPATHSEP(C) (C!="\\" ? (C=="/" ? 1 : 0 ) : 1)
                         ^^^^^^^    ^^^^^^
#define LC_ISPATHSEP(C) (C==":" ? 1 : 0 )

The Win32 'emulation' is in these files:

This works ok on Linux and Win32, I'm not sure if OSX was tested...

The code does need some work to be really usefull, but maybe some finds it usefull already.

If there is interest and maybe some additional platforms contributed, I'd love to do a proper Lua-module from it.

cheers, Martin