From 33d617d53584ae534e24fbc313ca0b3cc816a103 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Wed, 13 Nov 2024 20:34:36 -0700 Subject: skip leading whitespace to find command line modifiers --- src/makefile/command_line.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/makefile/command_line.rs b/src/makefile/command_line.rs index c75c854..9641941 100644 --- a/src/makefile/command_line.rs +++ b/src/makefile/command_line.rs @@ -87,7 +87,10 @@ impl CommandLine { // sometimes this is defined in macros rather than statically let execution_line: String = { - let mut line_chars = execution_line.chars().peekable(); + let mut line_chars = execution_line + .chars() + .skip_while(char::is_ascii_whitespace) + .peekable(); while let Some(x) = line_chars.next_if(|x| matches!(x, '-' | '@' | '+')) { match x { '-' => ignore_errors = true, -- cgit v1.2.3