Browse Source

Bugfix for newline exit

When stdin is close instead of pressing enter
Yann Weber 5 years ago
parent
commit
4432178af9
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      wtfstopw.asm

+ 2
- 1
wtfstopw.asm View File

@@ -230,19 +230,20 @@ main_loop:
230 230
 jmp main_loop ; main_loop
231 231
 
232 232
 flush_stdin:
233
+	jz newline_exit
233 234
 	xor rax, rax
234 235
 	;xor rdi, rdi ; done in main_loop
235 236
 	;mov rsi, r14
236 237
 	;mov rdx, 1
237 238
 	syscall
238 239
 	test al, al
239
-	jz newline_exit
240 240
 	jns flush_stdin
241 241
 
242 242
 	xor rbx, rbx ; EXIT OK
243 243
 	jmp exit
244 244
 
245 245
 	newline_exit:
246
+	mov rdi, 2 ; stderr
246 247
 	call proc_nl
247 248
 	xor rbx, rbx ; exit OK
248 249
 	jmp exit

Loading…
Cancel
Save