u-boot/test/cmd
Massimiliano Minella 4c73630686 cmd: setexpr: fix no matching string in gsub return empty value
In gsub, when the destination string is empty, the string 't' is
provided and the regular expression doesn't match, then the final result
is an empty string.

Example:

=> echo ${foo}

=> setenv foo
=> setexpr foo gsub e a bar
=> echo ${foo}

=>

The variable ${foo} should contain "bar" and the lack of match shouldn't
be considered an error.

This patch fixes the erroneous behavior by removing the return
statement and breaking out of the loop in case of lack of match.

Also add a test for the no match case.

Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com>
2024-03-02 12:26:19 -05:00
..
addrmap.c addrmap: Support on sandbox 2022-07-26 02:30:56 -06:00
armffa.c arm_ffa: introduce armffa command 2023-08-08 10:22:03 -04:00
bdinfo.c test: bdinfo: Add missing asserts 2023-12-13 18:39:05 -05:00
cmd_ut_cmd.c test: Add a new suite for commands 2023-12-13 18:39:04 -05:00
exit.c test: exit: fix run_commandf() warnings 2023-03-30 15:09:59 -04:00
fdt.c test: fdt: Add a special case for real boards 2023-12-13 18:39:05 -05:00
font.c test: font: Add dependencies on fonts 2023-12-13 18:39:05 -05:00
history.c cli: Add a command to show cmdline history 2023-10-11 15:43:54 -04:00
loadm.c cmd: load: add load command for memory mapped 2022-06-22 11:35:47 -04:00
Makefile test: add test of "cp" shell command 2024-01-17 08:00:05 -05:00
mbr.c test: cmd: mbr: Fix Smatch static checker warning 2024-03-02 12:25:20 -05:00
mem_copy.c test: add test of "cp" shell command 2024-01-17 08:00:05 -05:00
mem_search.c display_options: Drop two spaces before the ASCII column 2021-06-08 11:39:09 -04:00
mem.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
pci_mps.c test: Add test for new command pci_mps 2023-03-30 15:09:59 -04:00
pinmux.c test: dm: pinmux: Get LED2 udevice in the pinmux test 2022-04-28 09:26:44 -04:00
pwm.c test: Wrap assert macros in ({ ... }) and fix missing semicolons 2023-03-14 16:08:51 -06:00
rw.c test: add tests of 'read' and 'write' shell commands 2023-03-17 17:27:51 -04:00
seama.c cmd: Add a SEAMA image load command 2023-02-06 17:10:15 -05:00
setexpr.c cmd: setexpr: fix no matching string in gsub return empty value 2024-03-02 12:26:19 -05:00
temperature.c test: cmd: add test for temperature command 2022-10-11 16:03:04 -04:00
test_echo.c hush: Fix assignments being misinterpreted as commands 2021-04-12 17:17:11 -04:00
test_pause.c cmd: Add pause command 2022-09-02 13:40:42 -04:00
wget.c test: cmd: add test for wget command. 2022-11-28 13:06:40 -05:00