Skip to content

fix heredoc with delimiter and cat #575

@biralavor

Description

@biralavor

Command:

<< a cat + Ctrl-C + << a cat + Ctrl-C

Actual result:

<<< Born Again (mini) SHell >>>$ << a cat
(mini)heredoc<< ^C
<<< Born Again (mini) SHell >>>$ << a cat
(mini)heredoc<< ^C
<<< Born Again (mini) SHell >>>$ exit
==2483066== 
==2483066== FILE DESCRIPTORS: 5 open at exit.
==2483066== Open file descriptor 103: /usr/share/code/v8_context_snapshot.bin
==2483066==    <inherited from parent>
==2483066== 
==2483066== Open file descriptor 40: /dev/ptmx
==2483066==    <inherited from parent>
==2483066== 
==2483066== Open AF_UNIX socket 39: <unknown>
==2483066==    <inherited from parent>
==2483066== 
==2483066== Open file descriptor 38: /nfs/homes/umeneses/.config/Code/logs/20241010T213242/ptyhost.log
==2483066==    <inherited from parent>
==2483066== 
==2483066== Open file descriptor 37: /usr/share/code/resources/app/node_modules.asar
==2483066==    <inherited from parent>
==2483066== 
==2483066== 
==2483066== HEAP SUMMARY:
==2483066==     in use at exit: 204,854 bytes in 225 blocks
==2483066==   total heap usage: 888 allocs, 663 frees, 238,838 bytes allocated
==2483066== 
==2483066== 8 bytes in 2 blocks are indirectly lost in loss record 3 of 63
==2483066==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2483066==    by 0x40BCF4: ft_substr (ft_substr.c:30)
==2483066==    by 0x403B69: state_90 (11.state61_to_state90.c:95)
==2483066==    by 0x4032D3: get_state (08.get_state.c:36)
==2483066==    by 0x402D91: create_token_list (07.token_list_functions.c:22)
==2483066==    by 0x4028C7: loop_routine (05.loop_routine.c:77)
==2483066==    by 0x401B80: main (01.main.c:33)
==2483066== 
==2483066== 88 (80 direct, 8 indirect) bytes in 2 blocks are definitely lost in loss record 20 of 63
==2483066==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2483066==    by 0x40AFF8: ft_calloc (ft_calloc.c:34)
==2483066==    by 0x403A2A: state_90 (11.state61_to_state90.c:85)
==2483066==    by 0x4032D3: get_state (08.get_state.c:36)
==2483066==    by 0x402D91: create_token_list (07.token_list_functions.c:22)
==2483066==    by 0x4028C7: loop_routine (05.loop_routine.c:77)
==2483066==    by 0x401B80: main (01.main.c:33)
==2483066== 
==2483066== LEAK SUMMARY:
==2483066==    definitely lost: 80 bytes in 2 blocks
==2483066==    indirectly lost: 8 bytes in 2 blocks
==2483066==      possibly lost: 0 bytes in 0 blocks
==2483066==    still reachable: 0 bytes in 0 blocks
==2483066==         suppressed: 204,766 bytes in 221 blocks
==2483066== 
==2483066== For lists of detected and suppressed errors, rerun with: -s
==2483066== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions