Applying reformime subsequent on makemime

Denys Vlasenko vda.linux at googlemail.com
Mon Jul 6 19:27:43 UTC 2009


On Monday 06 July 2009 13:08, Vladimir Dronnikov wrote:
> >>
> >> So just a decision is needed how reformime should determine lines. Can
> >> you clarify it, Denys?
> >
> > Is it feasible to make reformime treat BOTH \n and \r\n
> > as end-of-line?
> 
> In fact this is the matter of the following condition:
> 
> 	while ((line = xmalloc_fgets_str(stdin, "\r\n\r\n")) != NULL) { ...
> 
> So we can do the following: upon the first occurance of \n to
> determine whether or not it is prepended by \r, and then use the rule
> to the whole content, right?

I do not understand the above.

Just read lines a-la fgets, strip trailing \n, *and if there is
trailing \r, strip it too.
--
vda


More information about the busybox mailing list