If there are a recovery file with backup, backup file is used for recovery
Change-Id: Iaf6bf7a8b46e7279a6e71ab7aa864d2106557a34
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
if (std::regex_search(file, match, backup_regex)) {
bf::path orig_file(iter->path().parent_path() / iter->path().stem());
if (bf::exists(orig_file))
- bf::remove(iter->path());
- else
- bf::rename(iter->path(), orig_file);
+ bf::remove(orig_file);
+ bf::rename(iter->path(), orig_file);
}
} catch (...) {
LOG(WARNING) << "Exception occurred: "