Thomas-Chqt / minishell

bash-like shell
MIT License
1 stars 0 forks source link

Here doc: return unexpected message when only newline #107

Closed jizots closed 1 year ago

jizots commented 1 year ago

ft_putstr_fd: write return 0 @Thomas-Chqt Can you reproduce the same thing on your PC? ex. `✘ minishell > <<a cat

ft_putstr_fd: write return 0> `

On my Mac, old git master(more than 2 weeks ago) reproduce same issue. I can't resolve this message came from, but I have a solution.

Thomas-Chqt commented 1 year ago

for me everything looks good

✔︎ minishell > <<a cat
> 
> 
> a

Leak Summary
Total Memory allocated 0 bytes
Total Memory freed     0 bytes
Memory Leaked          0 bytes

leaks Report Version: 4.0
Process 63387: 605 nodes malloced for 348 KB
Process 63387: 14 leaks for 4096 total leaked bytes.

    14 (4.00K) << TOTAL >>
      1 (512 bytes) ROOT LEAK: 0x7fe9f44047d0 [512]
      1 (512 bytes) ROOT LEAK: 0x7fe9f44050d0 [512]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44040d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44041d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44042d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44043d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44044d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44045d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f44046d0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f4404bd0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f4404cd0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f4404dd0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f4404ed0 [256]
      1 (256 bytes) ROOT LEAK: 0x7fe9f4404fd0 [256]
jizots commented 1 year ago

Memo: If get_next_line used, msg dose not print. Hypothesis : [Readline] function dose not return only newline. Only newline convert to null string (;\0).

jizots commented 1 year ago

105