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

add lang parameter to cfCatalogLoad() and others #2

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

TinyTrebuchet
Copy link
Contributor

  • cfCatalogSearchDirLocale() : Searches for catalog file matching locale
  • cfCatalogSearchDirLang(): Searches for catalog file matching only language prefix
  • cfCatalogSearchDir(): Searches for catalog file matching a preferred locale, but defaults to other locales if not found


// Check for language match, with any region
// Cover both cases, whether locale has region suffix or
strncpy(lang, preferredlocale, strcspn(preferredlocale, "_"));
Copy link
Member

Choose a reason for hiding this comment

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

Do we have the terminating zero here? Or is lang pre-filled with zeros?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know strncpy() didn't append a NULL terminator like snprintf() does. Fixed it now. Thanks!

@tillkamppeter tillkamppeter merged commit 86c0101 into OpenPrinting:master Dec 28, 2022
tillkamppeter pushed a commit to OpenPrinting/libppd that referenced this pull request Dec 28, 2022
In libcupsfilters we have added language/translation support to the `cfCatalog...()` API functions via OpenPrinting/libcupsfilters#2. This changes the `cfCatalogLoad()` calls in libppd (both in the PPD generator for driverless printing). This commit updates them.

For a quick solution we supply NULL as language for now, resembling the old behavior. We look into language support in the PPD generator later.
zdohnal added a commit to zdohnal/libcupsfilters that referenced this pull request Feb 10, 2023
zdohnal added a commit to zdohnal/libcupsfilters that referenced this pull request Feb 10, 2023
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