mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
resolve links if required to get the actual name of the dict
This commit is contained in:
parent
e90c5ee94f
commit
25a1ee451b
1 changed files with 9 additions and 1 deletions
|
@ -1408,6 +1408,14 @@ walk_dict_test_all( const LaunchParams* params, GSList* testDicts,
|
||||||
static void
|
static void
|
||||||
trimDictPath( const char* input, char* buf, int bufsiz, char** path, char** dict )
|
trimDictPath( const char* input, char* buf, int bufsiz, char** path, char** dict )
|
||||||
{
|
{
|
||||||
|
char unlinked[256];
|
||||||
|
XP_ASSERT( strlen(input) < VSIZE(unlinked) );
|
||||||
|
ssize_t siz = readlink( input, unlinked, VSIZE(unlinked) );
|
||||||
|
if ( 0 <= siz ) {
|
||||||
|
unlinked[siz] = '\0';
|
||||||
|
input = unlinked;
|
||||||
|
}
|
||||||
|
|
||||||
struct stat statBuf;
|
struct stat statBuf;
|
||||||
int statResult = stat( input, &statBuf );
|
int statResult = stat( input, &statBuf );
|
||||||
if ( 0 == statResult && S_ISLNK(statBuf.st_mode) ) {
|
if ( 0 == statResult && S_ISLNK(statBuf.st_mode) ) {
|
||||||
|
@ -1430,7 +1438,7 @@ trimDictPath( const char* input, char* buf, int bufsiz, char** path, char** dict
|
||||||
if ( !!dot && 0 == strcmp(dot, ".xwd") ) {
|
if ( !!dot && 0 == strcmp(dot, ".xwd") ) {
|
||||||
*dot = '\0';
|
*dot = '\0';
|
||||||
}
|
}
|
||||||
XP_LOGF( "%s=> dict: %s; path: %s", __func__, *dict, *path );
|
XP_LOGF( "%s => dict: %s; path: %s", __func__, *dict, *path );
|
||||||
}
|
}
|
||||||
|
|
||||||
XP_Bool
|
XP_Bool
|
||||||
|
|
Loading…
Reference in a new issue