Skip to content

Commit

Permalink
Simplify fill_pathname_representation_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Feb 4, 2018
1 parent f364d2d commit fa07570
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions file_path_special.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,18 @@ void fill_pathname_application_special(char *s,
void fill_short_pathname_representation_wrapper(char* out_rep,
const char *in_path, size_t size)
{
char *path_short = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
#ifdef HAVE_COMPRESSION
char *path_short = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
char *last_slash = NULL;
#endif

path_short[0] = '\0';
path_short[0] = '\0';

fill_pathname(path_short, path_basename(in_path), "",
PATH_MAX_LENGTH * sizeof(char)
);

#ifdef HAVE_COMPRESSION
last_slash = find_last_slash(path_short);

if (last_slash != NULL)
{
/* We handle paths like:
Expand All @@ -410,8 +409,9 @@ void fill_short_pathname_representation_wrapper(char* out_rep,
free(path_short);
return;
}

free(path_short);
#endif

fill_short_pathname_representation(out_rep, in_path, size);
free(path_short);
}

0 comments on commit fa07570

Please sign in to comment.