Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Jan 17, 2025
1 parent 030b308 commit 05bdd55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/elements/command/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ impl CaseCommand {
}

let mut ans = Self::new();
let mut ok = false;
ans.text = feeder.consume(4);

if ! Self::eat_word(feeder, &mut ans, core)?
Expand All @@ -137,6 +138,7 @@ impl CaseCommand {
}

if feeder.starts_with("esac") {
ok = true;
ans.text += &feeder.consume(4);
break;
}
Expand All @@ -162,7 +164,7 @@ impl CaseCommand {
}
}

if ans.patterns_script_end.len() > 0 {
if ok && ans.patterns_script_end.len() > 0 {
command::eat_redirects(feeder, core, &mut ans.redirects, &mut ans.text);
Ok(Some(ans))
}else{
Expand Down
2 changes: 1 addition & 1 deletion test/ok
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
./test_script.bash
./test_options.bash
./test_glob.bash
./test_redirects.bash
./test_glob.bash
./test_brace.bash
./test_builtins.bash
./test_others.bash
Expand Down

0 comments on commit 05bdd55

Please sign in to comment.