diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-06-25 19:56:45 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-06-25 20:00:34 +0200 |
commit | bcea5fe09f0835e5ea35fdfcb7355431f17cd0ee (patch) | |
tree | 697dffc31d109e299388e1fa58d5facb138f45cd /src/main.c | |
parent | 70260e6b8c8c6d322c1a32e14f984784b7bb0506 (diff) |
Move environment-based path initialization out of main.c
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 37 |
1 files changed, 1 insertions, 36 deletions
@@ -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<what>=<path>" 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 (?) */ |