From 5e819eab057dfc4e14813a190e9cf2c59d9e2da9 Mon Sep 17 00:00:00 2001 From: stan-sz <37585349+stan-sz@users.noreply.github.com> Date: Mon, 2 Jun 2025 13:35:10 +0200 Subject: [PATCH] Fix binlog argument passing for output file --- src/BinlogTool/Program.cs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/BinlogTool/Program.cs b/src/BinlogTool/Program.cs index b381ec46c..21aa26aab 100644 --- a/src/BinlogTool/Program.cs +++ b/src/BinlogTool/Program.cs @@ -83,15 +83,11 @@ binlogtool search *.binlog search string return 0; } - if (string.Equals(firstArg, "compilerinvocations", StringComparison.OrdinalIgnoreCase)) + if (args.Length >= 2 && string.Equals(firstArg, "compilerinvocations", StringComparison.OrdinalIgnoreCase)) { - string binlog = null; + string binlog = binlog = args[1]; string outputFile = null; - if (args.Length >= 2) - { - binlog = args[1]; - } - else if (args.Length == 3) + if (args.Length == 3) { outputFile = args[2]; } @@ -104,15 +100,11 @@ binlogtool search *.binlog search string return 0; } - if (string.Equals(firstArg, "doublewrites", StringComparison.OrdinalIgnoreCase)) + if (args.Length >= 2 && string.Equals(firstArg, "doublewrites", StringComparison.OrdinalIgnoreCase)) { - string binlog = null; + string binlog = binlog = args[1]; string outputFile = null; - if (args.Length >= 2) - { - binlog = args[1]; - } - else if (args.Length == 3) + if (args.Length == 3) { outputFile = args[2]; }