From 5646eb3fe44d6c7c485884ce9c049af4319db6eb Mon Sep 17 00:00:00 2001 From: Michael Black Date: Wed, 15 Jan 2020 15:58:04 -0600 Subject: [PATCH] Move hist_dir_stat --- tests/ampctl.c | 3 ++- tests/rigctl.c | 3 ++- tests/rotctl.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/ampctl.c b/tests/ampctl.c index 2f2e138b9..24c147b10 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -131,7 +131,6 @@ int main(int argc, char *argv[]) const char *hist_dir = NULL; const char hist_file[] = "/.ampctl_history"; char *hist_path = NULL; - struct stat hist_dir_stat; #endif /* HAVE_READLINE_HISTORY */ const char *amp_file = NULL; @@ -366,6 +365,8 @@ int main(int argc, char *argv[]) if (rd_hist || sv_hist) { int hist_path_size; + struct stat hist_dir_stat; + if (!(hist_dir = getenv("AMPCTL_HIST_DIR"))) { hist_dir = getenv("HOME"); diff --git a/tests/rigctl.c b/tests/rigctl.c index 66705ac5f..499bfa27c 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -136,7 +136,6 @@ int main(int argc, char *argv[]) const char *hist_dir = NULL; const char hist_file[] = "/.rigctl_history"; char *hist_path = NULL; - struct stat hist_dir_stat; #endif /* HAVE_READLINE_HISTORY */ const char *rig_file = NULL, *ptt_file = NULL, *dcd_file = NULL; @@ -573,6 +572,8 @@ int main(int argc, char *argv[]) if (rd_hist || sv_hist) { int hist_path_size; + struct stat hist_dir_stat; + if (!(hist_dir = getenv("RIGCTL_HIST_DIR"))) { hist_dir = getenv("HOME"); diff --git a/tests/rotctl.c b/tests/rotctl.c index ba45b5fc4..c1248aa88 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -131,7 +131,6 @@ int main(int argc, char *argv[]) const char *hist_dir = NULL; const char hist_file[] = "/.rotctl_history"; char *hist_path = NULL; - struct stat hist_dir_stat; #endif /* HAVE_READLINE_HISTORY */ const char *rot_file = NULL; @@ -391,6 +390,8 @@ int main(int argc, char *argv[]) if (rd_hist || sv_hist) { int hist_path_size; + struct stat hist_dir_stat; + if (!(hist_dir = getenv("ROTCTL_HIST_DIR"))) { hist_dir = getenv("HOME");