From bcea5fe09f0835e5ea35fdfcb7355431f17cd0ee Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Wed, 25 Jun 2014 19:56:45 +0200 Subject: Move environment-based path initialization out of main.c --- src/main.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 9ee3db4d..0e6a5907 100644 --- a/src/main.c +++ b/src/main.c @@ -105,41 +105,6 @@ static bool_ check_create_user_dir(void) } -/* - * Initialize and verify the file paths, and the score file. - * - * Use the ANGBAND_PATH environment var if possible, else use - * DEFAULT_PATH, and in either case, branch off appropriately. - * - * First, we'll look for the ANGBAND_PATH environment variable, - * and then look for the files in there. If that doesn't work, - * we'll try the DEFAULT_PATH constant. So be sure that one of - * these two things works... - * - * We must ensure that the path ends with "PATH_SEP" if needed, - * since the "init_file_paths()" function will simply append the - * relevant "sub-directory names" to the given path. - */ -static void init_stuff(void) -{ - char path[1024]; - - cptr tail; - - /* Get the environment variable */ - tail = getenv("TOME_PATH"); - - /* Use the angband_path, or a default */ - strcpy(path, tail ? tail : DEFAULT_PATH); - - /* Hack -- Add a path separator (only if needed) */ - if (!suffix(path, PATH_SEP)) strcat(path, PATH_SEP); - - /* Initialize */ - init_file_paths(path); -} - - /* * Handle a "-d=" option @@ -257,7 +222,7 @@ int main(int argc, char *argv[]) /* Get the file paths */ - init_stuff(); + init_file_paths_with_env(); /* Get the user id (?) */ -- cgit v1.2.3