diff options
Diffstat (limited to 'src/makefile')
-rw-r--r-- | src/makefile/input.rs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs index 7f49bef..cb53966 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -452,7 +452,15 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { Ok(x) => x, Err(err) => return Some((n, Err(err))), }; - let line = COMMENT.replace(&line, ""); + let line = if settings.strip_comments { + COMMENT + .replace(&line, "$1") + .replace(r"\#", "#") + .trim_end() + .to_owned() + } else { + line + }; line_pieces.push(line.trim_start().to_owned()); } } @@ -1063,4 +1071,17 @@ info: Ok(()) } + + #[test] + fn sdafjijsafjdoisdf() -> R { + let file = "\ +cursed: +\techo this uses the bash variable '$$#' and all that \\ +\techo yeah its value is $$# and it's really cool +"; + let args = Args::empty(); + let makefile = MakefileReader::read(&args, MacroSet::new(), Cursor::new(file), "")?; + let makefile = makefile.finish(); + Ok(()) + } } |