Skip to content
Snippets Groups Projects
Commit 21e473f9 authored by AdminXVII's avatar AdminXVII
Browse files

Allow comments if first char

parent 68cd0345
No related branches found
No related tags found
No related merge requests found
......@@ -192,7 +192,7 @@ impl<I: Iterator<Item = u8>> Terminator<I> {
self.array -= 1;
Some(b']')
}
b'#' if prev_whitespace => {
b'#' if prev_whitespace || self.inner.prev().is_none() => {
self.inner.find(|&c| c == b'\n');
if self.array == 0 && self.subshell == 0 && !self.and_or && !self.empty {
self.terminated = true;
......
......@@ -101,7 +101,7 @@ pub(crate) fn readln(shell: &mut Shell) -> Option<String> {
match line {
Ok(line) => {
if line.bytes().any(|c| !c.is_ascii_whitespace()) {
if line.bytes().next() != Some(b'#') && line.bytes().any(|c| !c.is_ascii_whitespace()) {
shell.flags |= flags::UNTERMINATED;
}
Some(line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment