From 388cd8f94f940618616f6e4a002513f8379b520f Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Wed, 30 Mar 2022 15:03:35 +0900 Subject: [PATCH] Change the naming rule for duplicate files Change-Id: I25a3010f7e3b8f76deccbfa44ac08966b9fc8441 --- agent/download-agent-file.c | 6 +++--- packaging/download-provider.spec | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/download-agent-file.c b/agent/download-agent-file.c index c60e6a9..90782ff 100755 --- a/agent/download-agent-file.c +++ b/agent/download-agent-file.c @@ -802,7 +802,7 @@ char *get_full_path_avoided_duplication(const char *in_dir, int extension_len = 0; int suffix_count = 0; /* means suffix on file name. up to "_99" */ - int suffix_len = (int)log10(MAX_SUFFIX_COUNT + 1) + 1; /* 1 means "_" */ + int suffix_len = (int)log10(MAX_SUFFIX_COUNT + 1) + 2; /* 2 means "()" */ if (!in_dir || !in_candidate_file_name) return DA_NULL; @@ -844,7 +844,7 @@ char *get_full_path_avoided_duplication(const char *in_dir, "%s/%s", dir, file_name); } else { snprintf(final_path, final_path_len, - "%s/%s_%d", dir, file_name, suffix_count); + "%s/%s(%d)", dir, file_name, suffix_count); } } else { if (suffix_count == 0) { @@ -852,7 +852,7 @@ char *get_full_path_avoided_duplication(const char *in_dir, "%s/%s.%s", dir, file_name, extension); } else { snprintf(final_path, final_path_len, - "%s/%s_%d.%s", + "%s/%s(%d).%s", dir, file_name, suffix_count, extension); } } diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index e000cd0..8503c2c 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -1,6 +1,6 @@ Name: download-provider Summary: Download the contents in background -Version: 2.3.3 +Version: 2.3.4 Release: 0 Group: Development/Libraries License: Apache-2.0 -- 2.7.4