Skip to content
Commit 9b1001b5 authored by Harald Sitter's avatar Harald Sitter 🐧
Browse files

use qbytearray instead of manual memory management

there's no real point to storing the original locale as cstring instead
of in a QBA. it does have the downside that we need to manually free the
string though. also QBA condenses the copy logic (it also was
way too verbose to begin with).

also this is more correct behavior... in the event that the setlocale
query returned nullptr (the request could not be honored) we'll want to
reset to a sane "default". the way to achieve that is by setting an
empty string, and that is precisely the behavior QBA will exhibit as
it's always at least {\0} even when constructed from a nullptr. i.e.
instead of calling `setlocale(..., nullptr)` (which is a query and
pointless) we would now call `setlocale(..., "")` which resets the
category from the process environment.
naturally when we actually got a string back we'll rest to that
parent e4192088
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment