mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Provide local implementation of the GNU variant of basename() under Windows.
This commit is contained in:
parent
13d0637357
commit
b675289f68
17
src/lsa.cc
17
src/lsa.cc
|
@ -131,6 +131,23 @@ Entry::Entry( File::Class & f )
|
||||||
read * sizeof( uint16_t ) );
|
read * sizeof( uint16_t ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WIN32
|
||||||
|
|
||||||
|
// Win32 features the usual Posix basename() which may modify its input. We
|
||||||
|
// provide our local implementation here instead.
|
||||||
|
|
||||||
|
char const * basename( char const * n )
|
||||||
|
{
|
||||||
|
char const * lastSep = strrchr( n, '\\' );
|
||||||
|
|
||||||
|
if ( !lastSep )
|
||||||
|
return n;
|
||||||
|
|
||||||
|
return lastSep + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
class LsaDictionary: public BtreeIndexing::BtreeDictionary
|
class LsaDictionary: public BtreeIndexing::BtreeDictionary
|
||||||
{
|
{
|
||||||
File::Class idx;
|
File::Class idx;
|
||||||
|
|
Loading…
Reference in a new issue