47 char *tessdata_prefix = getenv(
"TESSDATA_PREFIX");
49 if (argv0 !=
nullptr && *argv0 !=
'\0') {
52 }
else if (tessdata_prefix) {
59 DWORD length = GetModuleFileName(
nullptr, path,
sizeof(path));
60 if (length > 0 && length <
sizeof(path)) {
61 char* separator = std::strrchr(path,
'\\');
62 if (separator !=
nullptr) {
69 #if defined(TESSDATA_PREFIX)
73 #define _XSTR(a) _STR(a)
74 datadir = _XSTR(TESSDATA_PREFIX)
"/tessdata";
88 if ((strcmp(lastchar,
"/") != 0) && (strcmp(lastchar,
"\\") != 0))