#43908 [Bgs->Opn]: Add an optional parameter to exec() to not trim whitespace from output
| From: | jani@php.net | Date: | Fri, 18 Jul 2008 16:02:09 +0000 |
| Subject: | #43908 [Bgs->Opn]: Add an optional parameter to exec() to not trim whitespace from output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-126954@lists.php.net to get a copy of this message | ||
ID: 43908
Updated by: jani@php.net
-Summary: exec() swallows whitespace in output
Reported By: Arne dot Heizmann at csr dot com
-Status: Bogus
+Status: Open
-Bug Type: Program Execution
+Bug Type: Feature/Change Request
Operating System: Windows 2000
PHP Version: 5.2.5
New Comment:
Reclassified.
Previous Comments:
------------------------------------------------------------------------
[2008-07-18 14:28:05] Arne dot Heizmann at csr dot com
This is most certainly not expected behaviour, and furthermore, it is
dataloss.
If you must preserve backwards compatibility, which is certainly fair,
then I recommend you add a new boolean option to the exec() call to
preserve the whitespace. Either way, this bug is not bogus.
I have an application whose output may or may not contain lines that
contain only whitespace. I need for this whitespace to be preserved as
otherwise I cannot parse the output correctly.
Please note that I'm not talking about the trailing "\n" which is
mentioned in the documentation. I'm referring to all other whitespace,
especially spaces and tabs.
------------------------------------------------------------------------
[2008-07-17 23:43:21] jani@php.net
Expected behaviour and can not be changed. RTFM: http://php.net/exec
------------------------------------------------------------------------
[2008-06-02 13:26:52] Arne dot Heizmann at csr dot com
Could we have this fix in the next version please? Just remove all the
code that removes the whitespace?
------------------------------------------------------------------------
[2008-01-25 18:24:43] felipe@php.net
Because that is intentional, however, it affect results as your case,
when the string is consisting entirely of whitespace.
Well, anyway, maybe this isn't a good idea, it was only my idea.
------------------------------------------------------------------------
[2008-01-25 17:59:46] Arne dot Heizmann at csr dot com
> The actual implementation strip trailing whitespaces, my patch also
do
> it, but when the string contains only whitespaces, it remove just \r
> and \n.
So why are you explicitly fixing only half of the bug and leaving the
other half in?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43908
--
Edit this bug report at http://bugs.php.net/?id=43908&edit=1