From 9088137051478559579f38d5ceed550655eac077 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 12 May 2020 14:20:12 +0200 Subject: [PATCH] Remove unused function --- file_path_special.c | 50 --------------------------------------------- file_path_special.h | 18 ---------------- 2 files changed, 68 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 9841dd7743..29d811ff24 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -414,53 +414,3 @@ void fill_pathname_application_special(char *s, break; } } - -/** - * fill_short_pathname_representation: - * @out_rep : output representation - * @in_path : input path - * @size : size of output representation - * - * Generates a short representation of path. It should only - * be used for displaying the result; the output representation is not - * binding in any meaningful way (for a normal path, this is the same as basename) - * In case of more complex URLs, this should cut everything except for - * the main image file. - * - * E.g.: "/path/to/game.img" -> game.img - * "/path/to/myarchive.7z#folder/to/game.img" -> game.img - */ -void fill_short_pathname_representation_wrapper(char* out_rep, - const char *in_path, size_t size) -{ -#ifdef HAVE_COMPRESSION - char *path_short = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); - char *last_slash = NULL; - - path_short[0] = '\0'; - - fill_pathname(path_short, path_basename(in_path), "", - PATH_MAX_LENGTH * sizeof(char) - ); - - last_slash = find_last_slash(path_short); - - if (last_slash != NULL) - { - /* We handle paths like: - * /path/to/file.7z#mygame.img - * short_name: mygame.img: - * - * We check whether something is actually - * after the hash to avoid going over the buffer. - */ - strlcpy(out_rep, last_slash + 1, size); - free(path_short); - return; - } - - free(path_short); -#endif - - fill_short_pathname_representation(out_rep, in_path, size); -} diff --git a/file_path_special.h b/file_path_special.h index 12e85bb806..9eb7f39d4b 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -117,24 +117,6 @@ enum application_special_type APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_DISCORD_AVATARS }; -/** - * fill_short_pathname_representation: - * @out_rep : output representation - * @in_path : input path - * @size : size of output representation - * - * Generates a short representation of path. It should only - * be used for displaying the result; the output representation is not - * binding in any meaningful way (for a normal path, this is the same as basename) - * In case of more complex URLs, this should cut everything except for - * the main image file. - * - * E.g.: "/path/to/game.img" -> game.img - * "/path/to/myarchive.7z#folder/to/game.img" -> game.img - */ -void fill_short_pathname_representation_wrapper(char* out_rep, - const char *in_path, size_t size); - const char *file_path_str(enum file_path_enum enum_idx); bool fill_pathname_application_data(char *s, size_t len);