Skip to content
Snippets Groups Projects
Commit 32e0a4ef authored by Michael Aaron Murphy's avatar Michael Aaron Murphy
Browse files

Merge branch 'fix-termination' into 'master'

Fix termination of quoted strings containing "<<"

Closes #842

See merge request redox-os/ion!895
parents 0fa73071 2a7a7777
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ Before submitting a PR, ensure that you've run your tests locally and that they
pass. This can be done by running the following two commands:
```sh
cargo +nightly test --lib && bash examples/run_examples/sh
cargo +nightly test --lib && bash examples/run_examples.sh
```
## Format your code
......
......@@ -6,3 +6,15 @@ echo "\$hello"
echo "\\"
echo "\n"
echo "\""
echo "<"
echo '<'
echo "<<"
echo '<<'
echo "<<<"
echo '<<<'
echo ">"
echo '>'
echo ">>"
echo '>>'
echo ">>>"
echo '>>>'
......@@ -6,3 +6,15 @@ $hello
\
\n
"
<
<
<<
<<
<<<
<<<
>
>
>>
>>
>>>
>>>
......@@ -64,7 +64,7 @@ impl Terminator {
b'"' if !self.flags.intersects(Flags::SQUOTE) => {
self.flags ^= Flags::DQUOTE
}
b'<' if !self.flags.contains(Flags::SQUOTE | Flags::DQUOTE) => {
b'<' if !self.flags.intersects(Flags::SQUOTE | Flags::DQUOTE) => {
let as_bytes = self.buffer.as_bytes();
if Some(&b'<') == as_bytes.get(self.read) {
self.read += 1;
......
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