Skip to content

Commit

Permalink
Remove some unnecessary quotes around std::filesystem::path
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Jan 16, 2025
1 parent 043df13 commit 2ca0c62
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libutil/file-system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ void setWriteTime(
// doesn't support access time just modification time.
//
// System clock vs File clock issues also make that annoying.
warn("Changing file times is not yet implemented on Windows, path is '%s'", path);
warn("Changing file times is not yet implemented on Windows, path is %s", path);
#elif HAVE_UTIMENSAT && HAVE_DECL_AT_SYMLINK_NOFOLLOW
struct timespec times[2] = {
{
Expand All @@ -656,7 +656,7 @@ void setWriteTime(
},
};
if (utimensat(AT_FDCWD, path.c_str(), times, AT_SYMLINK_NOFOLLOW) == -1)
throw SysError("changing modification time of '%s' (using `utimensat`)", path);
throw SysError("changing modification time of %s (using `utimensat`)", path);
#else
struct timeval times[2] = {
{
Expand All @@ -670,17 +670,17 @@ void setWriteTime(
};
#if HAVE_LUTIMES
if (lutimes(path.c_str(), times) == -1)
throw SysError("changing modification time of '%s'", path);
throw SysError("changing modification time of %s", path);
#else
bool isSymlink = optIsSymlink
? *optIsSymlink
: fs::is_symlink(path);

if (!isSymlink) {
if (utimes(path.c_str(), times) == -1)
throw SysError("changing modification time of '%s' (not a symlink)", path);
throw SysError("changing modification time of %s (not a symlink)", path);
} else {
throw Error("Cannot modification time of symlink '%s'", path);
throw Error("Cannot modification time of symlink %s", path);
}
#endif
#endif
Expand Down Expand Up @@ -709,7 +709,7 @@ void copyFile(const fs::path & from, const fs::path & to, bool andDelete)
copyFile(entry, to / entry.path().filename(), andDelete);
}
} else {
throw Error("file '%s' has an unsupported type", from);
throw Error("file %s has an unsupported type", from);
}

setWriteTime(to, lstat(from.string().c_str()));
Expand All @@ -736,7 +736,7 @@ void moveFile(const Path & oldName, const Path & newName)
auto tempCopyTarget = temp / "copy-target";
if (e.code().value() == EXDEV) {
fs::remove(newPath);
warn("Can’t rename %s as %s, copying instead", oldName, newName);
warn("can’t rename %s as %s, copying instead", oldName, newName);
copyFile(oldPath, tempCopyTarget, true);
std::filesystem::rename(
os_string_to_string(PathViewNG { tempCopyTarget }),
Expand Down

0 comments on commit 2ca0c62

Please sign in to comment.