-
- Downloads
Don't abort() on unknown locale
When an application attempts to use an unknown locale, don't abort but rather fail normally, as Linux does on an unknown locale. Theoretically, Posix specifies newlocale() can also fail with EINVAL if the category_mask is malformed. However, the only reasonable usage of this function we support is when base=NULL (or "C" locale) and locale is again "C", and then we just ignore the category_mask. If that is not the case, we can just complain with ENOENT (meaning we couldn't find the named locale). In any case, callers like std::locale() don't actually care why newlocale() failed, and anyway assume a failure means the localename wasn't recognized. Reviewed-by:Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
Loading
Please register or sign in to comment