Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45965 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14897 invoked from network); 6 Nov 2009 03:19:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2009 03:19:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=kinch.zhang@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kinch.zhang@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.178 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kinch.zhang@gmail.com X-Host-Fingerprint: 209.85.216.178 mail-px0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:51255] helo=mail-px0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 42/80-11366-5A593FA4 for ; Thu, 05 Nov 2009 22:19:01 -0500 Received: by pxi8 with SMTP id 8so443286pxi.27 for ; Thu, 05 Nov 2009 19:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=BAvqysZP6c0zOKWDv6pCdPDCAXjVyQnOV165WfIE+Bw=; b=CqWBHkly+s9hcfuFyHxfMrN9wHzSSepnge+zrmB1ISCGKG+X1BzdpE7/o5fUvd2La1 /w6LBGYAftZeAW86IpCODFnnMSAZ0DCuecka6y8Rn2hgRui+a3FtUMd22D04m3Uk+RSB XuxTCL/IFInCnDrsC5/RnB8Q/fsxIllZYr1Sg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=Y/BxbiuPIbYstZAA1DnChl68vvEM5NiS2SMBpLkBuBrZJOmv0nquy3fu09MkGtpyXP 3Nvn6vLvMVMe19KfDa12q2lN4JMjjgkUxlLb/bQFHsL3CID0KDHzBB+cS0vn9wC8c1LY uoR8WrjSjmtKP1qkqn6ohp15lpFxadPEFs3EA= MIME-Version: 1.0 Received: by 10.142.75.16 with SMTP id x16mr420906wfa.155.1257477538111; Thu, 05 Nov 2009 19:18:58 -0800 (PST) Date: Fri, 6 Nov 2009 11:18:38 +0800 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001636e9144bf8e3730477ab4d89 Subject: typo found in ext/standard/string.c, inside function nl2br, php 5.3.0 svn trunk From: kinch.zhang@gmail.com (daqing) --001636e9144bf8e3730477ab4d89 Content-Type: text/plain; charset=UTF-8 hi, all: I just found a typo today when I read the source code of function nl2br, here is what 'svn diff' produce against the php 5.3.0 svn trunk: Index: ext/standard/string.c =================================================================== --- ext/standard/string.c (revision 290364) +++ ext/standard/string.c (working copy) @@ -3918,7 +3918,7 @@ tmp = str; end = str + str_len; - /* it is really faster to scan twice and allocate mem once insted scanning once + /* it is really faster to scan twice and allocate mem once instead scanning once and constantly reallocing */ while (tmp < end) { if (*tmp == '\r') { besides, I have a question: why not function nl2br just replace the "\r\n", "\n", "\r" things with "
"? why insert "
" before those "\r\n", "\n", "\r"? regards, Kinch Zhang -- "Simplicity is the essence of happiness." --001636e9144bf8e3730477ab4d89--