diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2025-09-24 05:45:33 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2025-10-07 10:05:08 +0200 |
| commit | 9443b0bc5efa33832a17567f98f8a950e29afbec (patch) | |
| tree | 31c3ea642764faf7a8b0a713939a269da13161ba | |
| parent | f5e1bf966b19ea1821f00a8c9ecd7774598689b4 (diff) | |
vi: warn about range in ':!' command
Currently vi in Busybox doesn't support filtering text through an
external command with ':1,2!cmd'. Instead it behaves as if no
range had been supplied and displays the output of the command.
Issue a warning and do nothing in such cases.
function old new delta
colon 3993 4010 +17
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | editors/vi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c index 34932f60c..f48bcf514 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -2951,6 +2951,10 @@ static void colon(char *buf) else if (cmd[0] == '!') { // run a cmd int retcode; // :!ls run the <cmd> + if (GOT_ADDRESS) { + status_line_bold("Range not allowed"); + goto ret; + } exp = expand_args(buf + 1); if (exp == NULL) goto ret; |
