From: [email protected]
> Sent: 21 November 2021 11:25
> 
> The POSIX.1-2008 specification of ed(1) mandates two command-line
> options: -p (for specifying a prompt string) and -s (to suppress writing
> of byte counts). This commit adds support for the former. Furthermore,
> it also changes the default prompt string to an empty string (instead
> of ": ") since this is also mandated by POSIX:
> 
>       -p string Use string as the prompt string when in command mode.
>                 By default, there shall be no prompt string.
> 
> Support for the remaining -s option will be added in a separate commit
> since it requires a general restructuring of error handling in Busybox
> ed.
...
> @@ -790,7 +792,7 @@ static void doCommands(void)
>                * 0  on ctrl-C,
>                * >0 length of input string, including terminating '\n'
>                */
> -             len = read_line_input(NULL, ": ", buf, sizeof(buf));
> +             len = read_line_input(NULL, prompt, buf, sizeof(buf));

Actually it is probably cleaner to put the NULL test when prompt is used:

        len = read_line_input(NULL, prompt ? prompt : "", buf, sizeof(buf));

Saves all the faffing about.

        David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, 
UK
Registration No: 1397386 (Wales)
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to