Re: [RFC/PATCH] i18n of multi-line messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt <j.sixt@xxxxxxxxxxxxx> writes:

> Am 12/22/2011 0:55, schrieb Junio C Hamano:
>>  void advise(const char *advice, ...)
>>  {
>> +	struct strbuf buf = STRBUF_INIT;
>>  	va_list params;
>> +	const char *cp, *np;
>>  
>>  	va_start(params, advice);
>> -	vreportf("hint: ", advice, params);
>> +	strbuf_addf(&buf, advice, params);
>>  	va_end(params);
>> +
>> +	for (cp = buf.buf; *cp; cp = np) {
>> +		np = strchrnul(cp, '\n');
>> +		fprintf(stderr, "%s%.*s\n", _("hint: "), (int)(np - cp), cp);
>> +		if (*np)
>> +			np++;
>> +	}
>> +	strbuf_release(&buf);
>>  }
>
> IMHO, this logic should be moved into vreportf(), and we get proper
> prefixing of multi-line warning(), error(), and die() messages for free.

Very very good point.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]