We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e2a594 commit d8b6d55Copy full SHA for d8b6d55
src/lib_ccx/ocr.c
@@ -51,7 +51,9 @@ static int search_language_pack(const char *dir_name, const char *lang_name)
51
52
// Search for a tessdata folder in the specified directory
53
char *dirname = strdup(dir_name);
54
- dirname = realloc(dirname, strlen(dirname) + strlen("tessdata/") + 1);
+ dirname = realloc(dirname, strlen(dirname) + strlen("tessdata/") + (dirname[strlen(dirname) - 1] != '/') + 1);
55
+ if (dirname[strlen(dirname) - 1] != '/')
56
+ strcat(dirname, "/");
57
strcat(dirname, "tessdata/");
58
59
DIR *dp;
0 commit comments