Skip to content

Commit

Permalink
prefix bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
calkan committed May 10, 2019
1 parent 3dc4289 commit 6c6e28e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,9 @@ void get_working_directory(parameters *params){

directory = strrchr(params->outprefix, '/');
prefix = NULL;
set_str( &prefix, directory + 1);
if ( debug_mode)
if (directory != NULL)
set_str( &prefix, directory + 1);
if ( debug_mode && prefix != NULL)
fprintf (stderr, "prefix: %s\n", prefix);

if (directory == NULL){
Expand All @@ -539,13 +540,15 @@ void get_working_directory(parameters *params){
params->outdir[i]='/';
params->outdir[i+1] = 0;

free( params->outprefix);
params->outprefix = NULL;
if ( debug_mode)
if ( debug_mode && prefix != NULL)
fprintf (stderr, "prefix2: %s\n", prefix);

set_str( &(params->outprefix), prefix);
free (prefix);

if (prefix!=NULL){
free( params->outprefix);
params->outprefix = NULL;
set_str( &(params->outprefix), prefix);
free (prefix);
}
}

char *get_file_name(char *path)
Expand Down

0 comments on commit 6c6e28e

Please sign in to comment.