From a7027a62c0df3a1d8f5c23f9f10dbd1cb72f4804 Mon Sep 17 00:00:00 2001 From: Bill-Gray Date: Mon, 5 Jun 2017 16:05:53 -0400 Subject: [PATCH] One can now set the 'configure' folder from the command line. Useful only when running a Windows/PDCurses version of Find_Orb using Wine in Linux... which I doubt anybody but me is going to do. But for me, it's useful. --- findorb.cpp | 10 +++++++++- miscell.cpp | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/findorb.cpp b/findorb.cpp index 6b837420..23803c9f 100644 --- a/findorb.cpp +++ b/findorb.cpp @@ -76,6 +76,7 @@ BMOUSE global_bmouse; #define BUTTON_CTRL BUTTON_CONTROL #endif +#include #include #include #include @@ -2262,7 +2263,15 @@ int main( const int argc, const char **argv) } break; case 'z': + { + extern const char *alt_config_directory; + use_config_directory = true; + alt_config_directory = argv[i] + 2; + if( !*alt_config_directory && i < argc - 1 + && argv[i + 1][0] != '-') + alt_config_directory = argv[i + 1]; + } break; default: printf( "Unknown command-line option '%s'\n", argv[i]); @@ -2367,7 +2376,6 @@ int main( const int argc, const char **argv) { /* no objects found, or file not found */ const char *err_msg; - endwin( ); if( n_ids == -1) err_msg = "Couldn't locate the file '%s'\n"; else diff --git a/miscell.cpp b/miscell.cpp index 1fe01bf4..b9ce2c5c 100644 --- a/miscell.cpp +++ b/miscell.cpp @@ -33,9 +33,16 @@ FILE *fopen_ext( const char *filename, const char *permits); /* miscell.cpp */ void make_config_dir_name( char *oname, const char *iname); /* miscell.cpp */ int use_config_directory = false; +const char *alt_config_directory; void make_config_dir_name( char *oname, const char *iname) { + if( alt_config_directory && *alt_config_directory) + { + strcpy( oname, alt_config_directory); + strcat( oname, iname); + return; + } #ifdef _WIN32 strcpy( oname, iname); #else