mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
Fix deadlock in stash levels
- use vertical tab character instead of "MAGIC" string to denote end of input - check for terminator using pattern match instead of eq Users are unable to provide special characters to Bash process so this should be relatively safe. Pattern match succeeds even when `git stash` omits newline while rendering commit subjects. Fixes git-learning-game/oh-my-git#56
This commit is contained in:
parent
ec9b467cc6
commit
c2a2f87f4c
1 changed files with 2 additions and 2 deletions
|
@ -34,12 +34,12 @@ while(true) {
|
||||||
STDOUT->flush();
|
STDOUT->flush();
|
||||||
|
|
||||||
$s = "";
|
$s = "";
|
||||||
$command = $s2 . "\necho MAGIC\n";
|
$command = $s2 . "\necho -e \"\\v\"\n";
|
||||||
print $in $command;
|
print $in $command;
|
||||||
|
|
||||||
inner_while: while (true) {
|
inner_while: while (true) {
|
||||||
$line = <$out>;
|
$line = <$out>;
|
||||||
if ($line eq "MAGIC\n") {
|
if ($line =~ s/\cK//) {
|
||||||
STDOUT->flush();
|
STDOUT->flush();
|
||||||
last inner_while;
|
last inner_while;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue