X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=include%2Fanna%2Ftime%2Finternal%2FTimezone.hpp;h=532ccc4333b7498d838ad44435da18f4f880879e;hp=0dff2f461fad1d3dc16350557208e6c153676346;hb=e782294456d0877aa8fc05aa931291ac79808eb3;hpb=7618e65d62aa5231b9399d6e361e884c38f49285 diff --git a/include/anna/time/internal/Timezone.hpp b/include/anna/time/internal/Timezone.hpp index 0dff2f4..532ccc4 100644 --- a/include/anna/time/internal/Timezone.hpp +++ b/include/anna/time/internal/Timezone.hpp @@ -99,10 +99,10 @@ public: bool apply() const throw() { // http://stackoverflow.com/questions/5873029/questions-about-putenv-and-setenv if(unsetTZ()) { - unsetenv("TZ"); - } - else { - setenv("TZ", a_value.c_str(), 1 /* overwrite */); + unsetenv("TZ"); + } + else { + setenv("TZ", a_value.c_str(), 1 /* overwrite */); /* // If TZ has an invalid setting, tzset() uses GMT0: @@ -115,15 +115,15 @@ public: if (!success) std::cerr << "Invalid TZ '" << a_value << "'. Probably GMT0 is going to be used instead !" << std::endl; return success; */ - } + } return true; } std::string asString() const throw() { std::string result = getValue(); - if (unsetTZ()) return ""; - if (result == "") return ""; + if (unsetTZ()) return "[TZ unset]"; + if (result == "") return "[TZ empty]"; return result; } };