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

Commit 3b5c6dca authored by Michael Runge's avatar Michael Runge Committed by Android Git Automerger
Browse files

am 2f0ef730: Treat already-renamed files as having no problems.

* commit '2f0ef730':
  Treat already-renamed files as having no problems.
parents 9eb8c8bd 2f0ef730
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -358,6 +358,9 @@ Value* RenameFn(const char* name, State* state, int argc, Expr* argv[]) {
    if (make_parents(dst_name) != 0) {
        ErrorAbort(state, "Creating parent of %s failed, error %s",
          dst_name, strerror(errno));
    } else if (access(dst_name, F_OK) == 0 && access(src_name, F_OK) != 0) {
        // File was already moved
        result = dst_name;
    } else if (rename(src_name, dst_name) != 0) {
        ErrorAbort(state, "Rename of %s to %s failed, error %s",
          src_name, dst_name, strerror(errno));