Skip to content

Commit

Permalink
set run_directory default to be empty string instead of NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaiton committed Jan 23, 2024
1 parent b97fa86 commit 2d4078e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/fclaw2d_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ static char* old_path = NULL;
void fclaw2d_set_global_context(fclaw2d_global_t *glob)
{
fclaw_options_t* opts = fclaw2d_get_options(glob);
fclaw_set_logging_prefix(opts->logging_prefix);

// Change run directory
if(opts->run_directory != NULL){
if(strcmp(opts->run_directory,"") != 0){
FCLAW_ASSERT(old_path == NULL);
fclaw_set_logging_prefix(opts->logging_prefix);
old_path = fclaw_cwd();
fclaw_cd(opts->run_directory);
}
Expand Down
3 changes: 2 additions & 1 deletion src/fclaw_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ fclaw_register (fclaw_options_t* fclaw_opt, sc_options_t * opt)
{
sc_options_add_string (opt, 0, "run-directory",
&fclaw_opt->run_directory,
NULL, "Directory for running simulation in, can be relative for absolute [cwd]");
"", "Directory for running simulation in, can be relative for absolute. "
"Empty string means use current working directory []");

/* -------------------------- Time stepping control ------------------------------- */

Expand Down

0 comments on commit 2d4078e

Please sign in to comment.