newlines in files

From: Date: Thu, 25 Oct 2001 16:46:02 +0000
Subject: newlines in files
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1720@lists.php.net to get a copy of this message
It was brought to my attention (by Roberto Berto) that there are newlines at the end of the Smarty files. I thought this was a bit odd at first, but yes they are in there. But, this seems to be the case with any file. For instance, with the VI editor (I tried nedit too), open a file, type "foo", then save it. If you do a raw dump of the file content, you will see that it does contain a new line "foo\n". I suppose this is they way (any?) editor behaves, putting this in as an EOF marker. So I'm wondering, is this a concern? Usually this would be a no, as a newline in an HTML document doesn't normally cause an issue. But it can, and especially if the content is something other than HTML or the content is encapsulated somehow. This also goes for all the templates you build with Smarty. They all most likely have newlines attached to the end. I'd like so see what other peoples thoughts are on this one. Do we take care to remove the newlines from the Smarty class files? This would involve a post-stripping of the newline anytime the file is edited I would think, unless I'm missing something obvious. Monte

« previous php.smarty.general (#1720) next »