Re: fputs() vs puts() (was: [PATCH] hwclock: remove unused usage() FILE argument)

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

 



On Thu, Jun 29, 2017 at 10:51:14AM +0200, Karel Zak wrote:
> On Wed, Jun 28, 2017 at 09:29:40PM +0200, Ruediger Meier wrote:
> > On Tuesday 20 June 2017, Karel Zak wrote:
> > > On Sun, Jun 18, 2017 at 08:49:49PM -0400, J William Piggott wrote:
> > > >  sys-utils/hwclock.c | 74
> > > > ++++++++++++++++++++++++++--------------------------- 1 file
> > > > changed, 37 insertions(+), 37 deletions(-)
> > >
> > > It would be better to remove this patch from the pull-request; let's
> > > keep fputs() in the code and wait for any solution from Rudi :-)
> > 
> > I have now finished my cleanup regarding stdout only. To make the diffs 
> > small I have left a useless definition "FILE *out = stdout;" in almost 
> > any usage function.
> > 
> > We can remove this "out" variable now everwhere using a sed or awk. But 
> > a few questions about what would be the best end state.
> > 
> > 1. fputs vs puts?:
> > 
> >    Is it a problem for translators if we remove a newline from almost
> >    any string? And, does puts() look more nice at all? I mean many usage
> >    functions have to use printf too, so does it look good if some
> >    strings are '\n' terminated and others not?
> 
> Frankly, I prefer to have \n in the string, because in this case you
> have full control on the output. And it also means all the strings
> modification... for me fputs() is the winner :-)

Note that I don't think we have to be so strict about it. For old already 
translated strings I prefer fputs to avoid \n changes, but for new
tools or after some massive change in usage() it's probbaly fine to
use puts(). Use common sense :-)

    Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux