[Libguestfs] [PATCH] fish: remove extra "prompt" checks

Richard W.M. Jones rjones at redhat.com
Wed Jan 21 14:00:53 UTC 2015


On Tue, Jan 20, 2015 at 04:28:40PM +0100, Pino Toscano wrote:
> The code is already within a "if (prompt) {...}" block, so checking for
> "prompt" again is redundant.
> ---
>  fish/fish.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fish/fish.c b/fish/fish.c
> index 8b74c7b..71db83a 100644
> --- a/fish/fish.c
> +++ b/fish/fish.c
> @@ -661,8 +661,8 @@ rl_gets (int prompt)
>        line_read = NULL;
>      }
>  
> -    p = prompt && ps1 ? decode_ps1 (ps1) : NULL;
> -    line_read = readline (prompt ? (ps1 ? p : FISH) : "");
> +    p = ps1 ? decode_ps1 (ps1) : NULL;
> +    line_read = readline (ps1 ? p : FISH);
>  
>      if (ps_output) {            /* GUESTFISH_OUTPUT */
>        CLEANUP_FREE char *po = decode_ps1 (ps_output);
> -- 
> 1.9.3

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list