[PATCH] Display full hostname in prompt with \H.

Denys Vlasenko vda.linux at googlemail.com
Thu Mar 28 12:21:25 UTC 2013


On Wed, Mar 27, 2013 at 5:46 PM, Arnaud Rébillout <rebillout at syscom.ch> wrote:
> I don't know whether this patch is of any interest, except for me.
>
> Signed-off-by: Arnaud Rébillout <rebillout at syscom.ch>
> ---
>  libbb/lineedit.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libbb/lineedit.c b/libbb/lineedit.c
> index 52b49e8..536a98c 100644
> --- a/libbb/lineedit.c
> +++ b/libbb/lineedit.c
> @@ -1802,6 +1802,9 @@ static void parse_and_put_prompt(const char *prmt_ptr)
>                                         pbuf = user_buf ? user_buf : (char*)"";
>                                         break;
>  # endif
> +                               case 'H':
> +                                       pbuf = free_me = safe_gethostname();
> +                                       break;
>                                 case 'h':
>                                         pbuf = free_me = safe_gethostname();
>                                         *strchrnul(pbuf, '.') = '\0';
> --
> 1.7.10.4


Thanks! I implemented it a bit differently. Please try current git.


More information about the busybox mailing list