From 574434898083a891f8b27b05e89c3e1a4bca01e3 Mon Sep 17 00:00:00 2001 From: Peter Vingelmann Date: Thu, 29 Sep 2016 19:49:06 +0200 Subject: [PATCH] Only change the return code if --print-changes is used with --dry-run --- src/astyle_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/astyle_main.cpp b/src/astyle_main.cpp index 9aad4ca..1edb592 100644 --- a/src/astyle_main.cpp +++ b/src/astyle_main.cpp @@ -3847,10 +3847,11 @@ int main(int argc, char** argv) g_console->processFiles(); int return_code = EXIT_SUCCESS; - if (g_console->getPrintChanges() && g_console->getFilesFormatted() > 0) + if (g_console->getIsDryRun() && g_console->getPrintChanges() + && g_console->getFilesFormatted() > 0) { // Use the number of formatted files as a return code with the - // --print-changes option + // --print-changes + --dry-run option return_code = g_console->getFilesFormatted(); }