Skip to content

Commit

Permalink
One can now set the 'configure' folder from the command line. Useful …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Bill-Gray committed Jun 5, 2017
1 parent c78ad86 commit a7027a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion findorb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ BMOUSE global_bmouse;
#define BUTTON_CTRL BUTTON_CONTROL
#endif

#include <wchar.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions miscell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a7027a6

Please sign in to comment.