[1417] in Moira
Re: Don't lose leading whitespace with mrbackup
daemon@ATHENA.MIT.EDU (K. Ramm)
Fri Mar 10 13:56:13 2000
To: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
Cc: Garry Zacheiss <zacheiss@MIT.EDU>, Mike Whitson <mwhitson@MIT.EDU>,
moiradev@MIT.EDU
From: kcr@MIT.EDU (K. Ramm)
Date: 10 Mar 2000 13:56:05 -0500
In-Reply-To: Bill Sommerfeld's message of "Fri, 10 Mar 2000 11:47:54 -0500"
Message-ID: <uusput2u01m.fsf@EMACS-MAKES-A-COMPUTER-SLOW.MIT.EDU>
Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us> writes:
> > Garry Zacheiss <zacheiss@MIT.EDU> writes:
> >
> > > You presumeably mean "t = s + strlen(s)" since having mrbackup
> >
> > ewww. adding integers + pointers. Yuck. I liked the for loop better.
>
> Welcome to C. If you wanted a type safe language, please go
> elsewhere. The for loop may be slower since strlen may be tuned to
> look at multiple characters at a time for a null.
That bit is type safe; IIRC, when you add an integer to a pointer, it gets
multiplied by the appropriate thing (1, in this case). I just think it's
bad style, unaesthetic, and less clear than the loop. If the possible
increased speed of strlen matters, then I think
t = &s[strlen(s)];
is more obvious about what it's doing, then though it requires more
punctuation.
>
> - Bill
kcr