[Top][All Lists]

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

Re: CVS update: MODIFIED: src ...

From: Derek Robert Price
Subject: Re: CVS update: MODIFIED: src ...
Date: Mon, 28 Jul 2003 08:13:29 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Paul Edwards wrote:

"Derek Robert Price" <derek@ximbiot.com> wrote in message 
strip_trailing_newlines (char *str)
   size_t len, origlen;
   len = origlen = strlen (str);

   while (len > 0 && str[len-1] == '\n' )
       str[--len] = '\0';
   return len != origlen;

This is approximately what is in there already. I just didn't check your last suggestion, assuming it would be only a semantic difference. I think the version checked in to subr.c actually uses one less operation each time through the loop, even if the variables aren't ideally named.



Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!
Two wrongs do not make a right.  Three lefts do.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]