From 3133c9d1ea2bc4306ad22c6b08f96de8e21c4c9c Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Mon, 10 Dec 2018 21:37:19 -0600
Subject: [PATCH] If DB_DIR is not set, set to default value of "DBASE"

---
 src/main.C | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/main.C b/src/main.C
index 2c82d91..a82bae7 100644
--- a/src/main.C
+++ b/src/main.C
@@ -7,12 +7,24 @@
 #include "THcInterface.h"
 #include <iostream>
 #include <cstring>
+#include <string>
+#include <cstdlib>
 
 using namespace std;
 
 int main(int argc, char **argv)
 {
   // Create a ROOT-style interactive interface
+  //
+
+  if (!std::getenv("DB_DIR")) {
+    std::string db_dir_env = "DBASE";
+    if (setenv("DB_DIR", db_dir_env.c_str(), 1)) {
+      std::cout << "Failed to set env var DB_DIR\n";
+    } else {
+      std::cout << "DB_DIR set to DBASE\n";
+    }
+  }
 
   // Handle convenience command line options
   bool print_version = false, no_logo = false;
-- 
GitLab