ID:               33790
 User updated by:  marcus at names dot co dot uk
 Reported By:      marcus at names dot co dot uk
 Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: Linux 2.4
 PHP Version:      4.4.0
 New Comment:

Description should read, "all white space 
is removed FROM THE END OF EACH LINE, rather than just 
new line characters".


Previous Comments:
------------------------------------------------------------------------

[2005-07-20 17:11:10] marcus at names dot co dot uk

Description:
------------
Each line in the output array returned as the second 
parameter of exec() is trimmed so that all white space 
is removed, rather than just new line characters. 

I found this issue while trying to use the following 
command to find all files in the current directory whose 
name ends in a space:

exec("find . -name '* '",$output_array,$status);

However, in $output_array the filenames have been 
trimmed so that they no longer end in a space.

Reproduce code:
---------------
exec("find . -name '* '",$output_array,$status);

Expected result:
----------------
array(
    "file1 "
    "file2 "
);

Actual result:
--------------
array(
    "file1"
    "file2"
);


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33790&edit=1

Reply via email to