No description
Find a file
Khaïs COLIN e5027323e1 fix(field_splitting): ensure no extraneous spaces appear
debug notes:
= 250  !! OK ===================================================================
export HOLA="bonjour "
echo $HOLA | cat -e
= out =
bonjour $

= err =
rc: 0

= refout =
bonjour$

++++++++++++++++++++++++++++++++++++++++++++++++++++
failed: quote removal before word splitting
++++++++++++++++++++++++++++++++++++++++++++++++++++
++++ test input:
export VAR="hello "
echo $VAR | cat -e
++++ Got output:
hello $
++++ But expected:
hello$

Problem is in post-processing:
parsed command
 ╰─ t_cmd
     ├─ t_cmd_type = FT_SIMPLE
     ├─ flags = 0
     ├─ line = 0
     ╰─ value
         ╰─ t_simple_cmd
             ├─ line = 0
             ├─ t_wordlist
             │   ├─ t_worddesc
             │   │   ├─ word   = [echo]
             │   │   ├─ marker = [    ]
             │   │   ├─ flags = 0
             │   │   ╰─ t_token_type = WORD_TOKEN
             │   ╰─ t_worddesc
             │       ├─ word   = [$VAR]
             │       ├─ marker = [    ]
             │       ├─ flags = 1
             │       ╰─ t_token_type = WORD_TOKEN
             ╰─ redirections = (empty redir list)
about to post-process
 ╰─ t_simple_cmd
     ├─ line = 0
     ├─ t_wordlist
     │   ├─ t_worddesc
     │   │   ├─ word   = [echo]
     │   │   ├─ marker = [    ]
     │   │   ├─ flags = 0
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ╰─ t_worddesc
     │       ├─ word   = [$VAR]
     │       ├─ marker = [    ]
     │       ├─ flags = 1
     │       ╰─ t_token_type = WORD_TOKEN
     ╰─ redirections = (empty redir list)
about to post-process
 ╰─ t_simple_cmd
     ├─ line = 0
     ├─ t_wordlist
     │   ├─ t_worddesc
     │   │   ├─ word   = [echo]
     │   │   ├─ marker = [    ]
     │   │   ├─ flags = 0
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ╰─ t_worddesc
     │       ├─ word   = [hello ]
     │       ├─ marker = [$$$$$$]
     │       ├─ flags = 1
     │       ╰─ t_token_type = WORD_TOKEN
     ╰─ redirections = (empty redir list)
about to post-process
 ╰─ t_simple_cmd
     ├─ line = 0
     ├─ t_wordlist
     │   ├─ t_worddesc
     │   │   ├─ word   = [echo]
     │   │   ├─ marker = [    ]
     │   │   ├─ flags = 0
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ├─ t_worddesc
     │   │   ├─ word   = [hello]
     │   │   ├─ marker = [$$$$$]
     │   │   ├─ flags = 1
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ╰─ t_worddesc <---- WHAT IS THIS DOING HERE???
     │       ├─ word   = []
     │       ├─ marker = []
     │       ├─ flags = 1
     │       ╰─ t_token_type = WORD_TOKEN
     ╰─ redirections = (empty redir list)
about to post-process
 ╰─ t_simple_cmd
     ├─ line = 0
     ├─ t_wordlist
     │   ├─ t_worddesc
     │   │   ├─ word   = [echo]
     │   │   ├─ marker = [    ]
     │   │   ├─ flags = 0
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ├─ t_worddesc
     │   │   ├─ word   = [hello]
     │   │   ├─ marker = [$$$$$]
     │   │   ├─ flags = 1
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ╰─ t_worddesc
     │       ├─ word   = []
     │       ├─ marker = []
     │       ├─ flags = 1
     │       ╰─ t_token_type = WORD_TOKEN
     ╰─ redirections = (empty redir list)
about to execute
 ╰─ t_simple_cmd
     ├─ line = 0
     ├─ t_wordlist
     │   ├─ t_worddesc
     │   │   ├─ word   = [echo]
     │   │   ├─ marker = [(null)]
     │   │   ├─ flags = 0
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ├─ t_worddesc
     │   │   ├─ word   = [hello]
     │   │   ├─ marker = [(null)]
     │   │   ├─ flags = 1
     │   │   ╰─ t_token_type = WORD_TOKEN
     │   ╰─ t_worddesc
     │       ├─ word   = []
     │       ├─ marker = [(null)]
     │       ├─ flags = 1
     │       ╰─ t_token_type = WORD_TOKEN
     ╰─ redirections = (empty redir list)

Problem seems to be in field splitting
2025-04-25 14:32:16 +02:00
libft debug: remove *alloc/free debug information 2025-03-10 13:22:29 +00:00
src fix(field_splitting): ensure no extraneous spaces appear 2025-04-25 14:32:16 +02:00
tests debug: worddesc show more information 2025-04-15 15:17:51 +02:00
.gitignore ignore zms_tester 2025-04-16 12:48:23 +02:00
.valgrindrc valgrind: suppress readline still reachable leaks 2025-02-07 15:29:43 +01:00
grammar.md parse-cmd: Almost done but stopped by the gong 2025-04-08 19:56:46 +02:00
interesting_tests.md Expansion : text replacement in a string 2025-03-21 10:04:25 +01:00
Makefile fix(get_command_path): leak when path unset and calling file present in current dir 2025-04-24 18:03:25 +02:00
NOTES.md cmdlist: use new architecture (STUB) 2025-03-28 14:50:37 +01:00
readline.supp leaks: ignore readline add_history leaks 2025-03-28 14:50:37 +01:00
test.sh fix(field_splitting): ensure no extraneous spaces appear 2025-04-25 14:32:16 +02:00