h-vetinari commented on code in PR #1882:
URL: https://github.com/apache/orc/pull/1882#discussion_r1558868194


##########
c++/src/Timezone.cc:
##########
@@ -659,7 +659,15 @@ namespace orc {
   const char* getTimezoneDirectory() {
     const char* dir = getenv("TZDIR");
     if (!dir) {
-      dir = DEFAULT_TZDIR;
+      // this is present if we're in an activated conda environment
+      const char* conda_prefix = getenv("CONDA_PREFIX");

Review Comment:
   sure!



##########
c++/src/Timezone.cc:
##########
@@ -659,7 +659,15 @@ namespace orc {
   const char* getTimezoneDirectory() {
     const char* dir = getenv("TZDIR");
     if (!dir) {
-      dir = DEFAULT_TZDIR;
+      // this is present if we're in an activated conda environment
+      const char* conda_prefix = getenv("CONDA_PREFIX");
+      if (conda_prefix) {
+        std::string conda_dir(conda_prefix);
+        conda_dir += "/share/zoneinfo";
+        dir = conda_dir.c_str();

Review Comment:
   Not sure I understand (but then, my C++ is limited...); `dir` is `const char 
*`, and `std::string` doesn't auto-convert. How should I set `dir` with the 
correct value? I can also construct the `conda_dir` path differently if you 
want, I just followed the example from `getTimezoneByName` that was using 
`std::string`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to