From:             gabriel dot magniez at steria dot com
Operating system: Linux (Debian)
PHP version:      5.2.6
PHP Bug Type:     Streams related
Bug description:  Problem with fgets and \ followed by n

Description:
------------
When I read a stream line by line with the function fgets, this function
seems to interprete the two characters "\" followed by "n" as the "\n" (end
of line) character.
My problem is that I attemp to read a shell script which contains these
two characters but I would like that fgets don't transform these into the
control character "\n".

Reproduce code:
---------------
$str = fgets($this->stream)

Expected result:
----------------
Only on line (ex: echo "abc\ndef")

Actual result:
--------------
Two lines:
echo "abc
def"


-- 
Edit bug report at http://bugs.php.net/?id=45115&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45115&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45115&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45115&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45115&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45115&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45115&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45115&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45115&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45115&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45115&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45115&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45115&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45115&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45115&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45115&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45115&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45115&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45115&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45115&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45115&r=mysqlcfg

Reply via email to