mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-13 19:04:54 +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();
|
||||
|
||||
$s = "";
|
||||
$command = $s2 . "\necho MAGIC\n";
|
||||
$command = $s2 . "\necho -e \"\\v\"\n";
|
||||
print $in $command;
|
||||
|
||||
inner_while: while (true) {
|
||||
$line = <$out>;
|
||||
if ($line eq "MAGIC\n") {
|
||||
if ($line =~ s/\cK//) {
|
||||
STDOUT->flush();
|
||||
last inner_while;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue