Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore illegal TESSDATA_PREFIX (not existing filesystem entry, issue #4277) #4278

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Jul 3, 2024

Don't check for a directory, because a symbolic link is also allowed.

@@ -48,6 +49,12 @@ void CCUtil::main_setup(const std::string &argv0, const std::string &basename) {

const char *tessdata_prefix = getenv("TESSDATA_PREFIX");

// Ignore TESSDATA_PREFIX if there is no matching filesystem entry.
if (tessdata_prefix != nullptr && ! std::filesystem::exists(tessdata_prefix)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not a space typo ! it is easier to use fs as

namespace fs = std::filesystem;
if (!fs::exists(...))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a space typo which is fixed now, thanks for the hint.

…esseract-ocr#4277)

Don't check for a directory, because a symbolic link is also allowed.

Signed-off-by: Stefan Weil <[email protected]>
@stweil stweil merged commit bc490ea into tesseract-ocr:main Jul 3, 2024
7 checks passed
@stweil stweil deleted the issue4277 branch July 3, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants