Skip to content

Commit

Permalink
Fix for loading ecl_summary restart case.
Browse files Browse the repository at this point in the history
The loading of a restarted case was wrong in the summary loader when the
restarted case was given as an absolute pathname.
  • Loading branch information
joakim-hove committed Feb 1, 2018
1 parent 3e25939 commit bcf6bcc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/ecl/ecl_smspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,9 +1017,13 @@ static void ecl_smspec_load_restart( ecl_smspec_type * ecl_smspec , const ecl_fi
util_alloc_file_components( ecl_smspec->header_file , &path , NULL , NULL );
smspec_header = ecl_util_alloc_exfilename( path , restart_base , ECL_SUMMARY_HEADER_FILE , ecl_smspec->formatted , 0);
if (!util_same_file(smspec_header , ecl_smspec->header_file)) /* Restart from the current case is ignored. */ {
char * tmp_path = util_alloc_filename( path , restart_base , NULL );
ecl_smspec->restart_case = util_alloc_abs_path(tmp_path);
free( tmp_path );
if (util_is_abs_path(restart_base))
ecl_smspec->restart_case = util_alloc_string_copy( restart_base );
else {
char * tmp_path = util_alloc_filename( path , restart_base , NULL );
ecl_smspec->restart_case = util_alloc_abs_path(tmp_path);
free( tmp_path );
}
}

util_safe_free( path );
Expand Down

0 comments on commit bcf6bcc

Please sign in to comment.