{"thread":{"id":"43598","subject":"Test t4118 fails on Mac OS X due to dependency on GNU sed behaviour","startedAt":"2006-12-02T20:14:10Z","lastAt":"2006-12-02T20:14:10Z","messageCount":1,"participants":["Marco Roeland"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"295793","messageId":"20061202201410.GA6353@fiberbit.xs4all.nl","threadId":"43598","inReplyTo":null,"subject":"Test t4118 fails on Mac OS X due to dependency on GNU sed behaviour","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2006-12-02T20:14:10Z","receivedAt":"2006-12-02T20:14:10Z","isPatch":false,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"Hello list!\n\nRecently test t4118 was added to prepare for upcoming changes in\nbehaviour of GNU diff.\n\nThis test fails on Mac OS X. It turns out that in the end the failure\ncomes from a difference in the behaviour between GNU sed and the version\nthat comes with OS X.\n\nThe feature that is tested works fine, but the implementation of the\nexamination of the result fails.\n\nThe difference is that the OS X version of sed always ends the last line\nwith a newline character, even if it wasn't there in the input. Strictly\nspeaking this is POSIX specified behaviour that was changed in the GNU\nversion of sed in 1997, citing from the changelog for the historically\ncurious minded people:\n\nMon Jul 28 10:50:41 PDT 1997  Ken Pizzini <ken@gnu.org>\n\n* sed.c, sed.h, execute.c: POSIX.2, section 4.55.7, says that\n        a newline must end *every* output line.  But I think\n        that it is useful (when seding a binary file) to omit\n        a trailing newline if the input lacks one.  Thus the addition of\n        POSIXLY_CORRECT behavior.\n\n* execute.c: however, when seding multiple files my feeling\n        is that it makes sense to have each file but the last\n        behave as-if it ended in a newline.  Modified read_pattern_space()\n        accordingly.\n\nA workaround on Mac OS X is easy by for example just installing the GNU\nversion of sed from the 'fink' archive with \"sudo apt-get install sed\".\nFunny enough the system 'diff' is already the GNU version, so the test\nt4118 itself might even be necessary for upcoming feline versions of\nOS X!\n\nUnfortunately I myself don't see an elegant and portable fix in the test\nitself... [hint]\n-- \n"}]}