On Fri, 15 Jul 2011 23:28:06 +0200 Ulrich Eckhardt <[email protected]> said:
> On Thursday 14 July 2011 16:36:58 Vincent Torri wrote: > > raster added a 'dos2unix' function in epp to remove trailing \r (rev > > 59799). > > As I understand it, it converts '\r\n' to '\n' in a string. > > > > However, when i compare the files generated by epp on Windows and > > linux (just after line 751 of edje_cc_parse.c), they have a different size > > (windows one is bigger). When I run the dos2unix tool I have on the > > windows file, then there is no difference between the unix and window file > > anymore. > > Where exactly is the difference in the file? Does it have multiple lines at > all? Try running hexdump/hd on it to get a bytewise comparison. > > > There is a problem with the dos2unix function, it reads beyond the supplied > buffer if the last byte is a '\r'. I don't think this is actually a problem, intentional. indeed as u noticed we alloc an extra 2 bytes. 1 is for the 0 byte delimiter of the string.. the other.. just for giggles :) > because the allocated buffer is two bytes (why two?) larger than the file's > size. Also, it allocates another, even larger buffer although it can only > shrink the required length. I'm not sure if any combination of events there > can lead to any weirdness. Just to be sure, can you try the attached patch. > > > Cheers! > > > Uli -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
