Move hist_dir_stat

This commit is contained in:
Michael Black 2020-01-15 15:58:04 -06:00
parent 818937d6f8
commit 5646eb3fe4
No known key found for this signature in database
GPG Key ID: 6599353EC683404D
3 changed files with 6 additions and 3 deletions

View File

@ -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");

View File

@ -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");

View File

@ -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");