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

Arnaud Rébillout rebillout at syscom.ch
Thu Mar 28 16:18:24 UTC 2013


Cool, thanks for the list of supported escape sequences also.

Regards

On 03/28/2013 01:21 PM, Denys Vlasenko wrote:
> 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.
>


-- 
Arnaud Rébillout
SYSCOM Instruments SA
rue de l'industrie 21
CH-1450 Sainte-Croix
Switzerland
Tel: +41 (0)24 455 44 11



More information about the busybox mailing list