summaryrefslogtreecommitdiff
path: root/Userland/Utilities/gml-format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Utilities/gml-format.cpp')
-rw-r--r--Userland/Utilities/gml-format.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Utilities/gml-format.cpp b/Userland/Utilities/gml-format.cpp
index cd0d441243..84d014bff8 100644
--- a/Userland/Utilities/gml-format.cpp
+++ b/Userland/Utilities/gml-format.cpp
@@ -30,6 +30,8 @@ ErrorOr<bool> format_file(StringView path, bool inplace)
}
auto formatted_gml = formatted_gml_or_error.release_value();
if (inplace && !read_from_stdin) {
+ if (formatted_gml == contents)
+ return true;
if (!file->seek(0) || !file->truncate(0)) {
warnln("Could not truncate {}: {}", path, file->error_string());
return false;