Skip to content

Commit 03a9c66

Browse files
committed
fixup! mingw: Support git_terminal_prompt with more terminals
Move 'close(child.out)' down. Signed-off-by: Karsten Blees <[email protected]>
1 parent 31741af commit 03a9c66

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compat/terminal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,12 @@ static char *xterm_prompt(const char *prompt, int echo)
124124
if (write_in_full(child.in, prompt, prompt_len) != prompt_len) {
125125
error("Could not write to xterm");
126126
close(child.in);
127-
close(child.out);
128127
goto ret;
129128
}
130129
close(child.in);
131130

132131
strbuf_reset(&buffer);
133132
len = strbuf_read(&buffer, child.out, 1024);
134-
close(child.out);
135133
if (len < 0) {
136134
error("Could not read from xterm");
137135
goto ret;
@@ -141,6 +139,7 @@ static char *xterm_prompt(const char *prompt, int echo)
141139
strbuf_strip_suffix(&buffer, "\r");
142140

143141
ret:
142+
close(child.out);
144143
if (!code)
145144
finish_command(&child);
146145

0 commit comments

Comments
 (0)