Skip to content

Commit b7b6b28

Browse files
committed
Fixed Tessdata directory for Windows
The old code ignored the drive letter for the tessdata directory path. Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
1 parent 4b50f3f commit b7b6b28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ccutil/mainblk.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ void CCUtil::main_setup(const char *argv0, const char *basename) {
6464
#if defined(_WIN32)
6565
} else if (datadir == NULL || access(datadir.string(), 0) != 0) {
6666
/* Look for tessdata in directory of executable. */
67+
static char drive[4];
6768
static char dir[128];
6869
static char exe[128];
6970
DWORD length = GetModuleFileName(NULL, exe, sizeof(exe));
7071
if (length > 0 && length < sizeof(exe)) {
71-
_splitpath(exe, NULL, dir, NULL, NULL);
72-
datadir = dir;
72+
_splitpath(exe, drive, dir, NULL, NULL);
73+
datadir = drive;
74+
datadir += dir;
7375
}
7476
#endif /* _WIN32 */
7577
#if defined(TESSDATA_PREFIX)

0 commit comments

Comments
 (0)