Mail Archives: djgpp-workers/2002/12/23/08:25:52
Hello.
Charles Sandmann wrote:
>
> > Are you sure this doesn't break symlinks? Symlinks are text files with
> > newlines, so don't we need read rather than _read, to convert CRLFs to
> > newlines? I would check this, but I don't want to do a 'cvs update', until
> > I've hunted down some other bugs.
>
> This is what I plan to do to fix it, but thought I would test first.
> strpbrk is already pulled into the base image size by xsymlink.
> Below should work on either \n or \r\n terminated lines (or even \r ...)
> Sorry for the screwup
Looks good to me. I'll give it some testing, if I have time.
> *** _irdlink.bak Sat Dec 21 17:21:46 2002
> --- _irdlink.c Sun Dec 22 23:45:52 2002
> *************** int __internal_readlink(const char * __p
> *** 118,124 ****
> }
>
> data_buf = buf + _SYMLINK_PREFIX_LEN;
> ! bytes_read = strchr(data_buf, '\n') - data_buf;
> if( (unsigned)bytes_read > __max )
> bytes_read = __max;
> memcpy(__buf, data_buf, bytes_read);
> --- 118,124 ----
> }
>
> data_buf = buf + _SYMLINK_PREFIX_LEN;
> ! bytes_read = strpbrk(data_buf, "\r\n") - data_buf;
> if( (unsigned)bytes_read > __max )
> bytes_read = __max;
> memcpy(__buf, data_buf, bytes_read);
Thanks, bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -