Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bb74952 authored by Nandana Dutt's avatar Nandana Dutt Committed by android-build-merger
Browse files

Merge "Add rename code back" am: a1a42818 am: 217abc6f

am: 21fdeb42

Change-Id: I53359823701e5dedd43cdfc9b6bb53b45b42ecea
parents dcfabc70 21fdeb42
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1864,6 +1864,17 @@ static void FinalizeFile() {
            do_text_file = true;
        } else {
            do_text_file = false;
            // If the user has changed the suffix, we need to change the zip file name.
            std::string new_path = ds.GetPath(".zip");
            if (ds.path_ != new_path) {
                MYLOGD("Renaming zip file from %s to %s\n", ds.path_.c_str(), new_path.c_str());
                if (rename(ds.path_.c_str(), new_path.c_str())) {
                    MYLOGE("rename(%s, %s): %s\n", ds.path_.c_str(), new_path.c_str(),
                           strerror(errno));
                } else {
                    ds.path_ = new_path;
                }
            }
        }
    }
    if (do_text_file) {