Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63593 invoked by uid 1010); 14 Jul 2006 20:27:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63573 invoked from network); 14 Jul 2006 20:27:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2006 20:27:28 -0000 X-PHP-List-Original-Sender: tobias@schlitt.info X-Host-Fingerprint: 87.106.7.192 hartes-php.de Linux 2.5 (sometimes 2.4) (4) Received: from ([87.106.7.192:54366] helo=schlitt.info) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id F0/BB-41830-D6DF7B44 for ; Fri, 14 Jul 2006 16:24:15 -0400 Received: (qmail 8184 invoked by uid 210); 14 Jul 2006 22:25:10 +0200 Received: from 84.61.143.43 by hartes-php.de (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.88.3/1598. spamassassin: 3.1.3. perlscan: 1.25st. Clear:RC:1(84.61.143.43):. Processed in 0.083008 secs); 14 Jul 2006 20:25:10 -0000 Received: from dslb-084-061-143-043.pools.arcor-ip.net (HELO ?192.168.0.2?) (tobias@schlitt.info@84.61.143.43) by hartes-php.de with ESMTPA; 14 Jul 2006 22:25:09 +0200 Message-ID: <44B7FC8B.1090300@schlitt.info> Date: Fri, 14 Jul 2006 22:20:27 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041124 Thunderbird/0.9 Mnenhy/0.6.0.104 MIME-Version: 1.0 To: Christian Schneider CC: internals@lists.php.net References: <44B7F0E8.1080001@schlitt.info> <44B7F9F8.7010201@cschneid.com> In-Reply-To: <44B7F9F8.7010201@cschneid.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Tiny pathinfo() patch From: tobias@schlitt.info (Tobias Schlitt) On 07/14/2006 10:09 PM Christian Schneider wrote: > Tobias Schlitt wrote: >> using string manipulation, I now patched pathinfo() to provide the >> filename without extension per default with key "filename". >> >> Find the patch here: http://schlitt.info/misc/pathinfo.patch > If the patch is considered then I would propose to also return the key > "filename" if the filename does not have a suffix. The current code > seems to only return it if it can find a '.' in the filename. > > I.e. change > if (p) { > idx = p - ret; > add_assoc_stringl(tmp, "filename", ret, idx, 1); > } > > to > idx = p ? (p - ret) : ret_len; > add_assoc_stringl(tmp, "filename", ret, idx, 1); > or something like that. Valid point. I updated the patch. Have a nice weekend! Toby -- Tobias Schlitt - Zend Certified Engineer GPG Key: 0xC462BC14 a passion for php http://www.schlitt.info Like to say "thank you"? - http://pear.php.net/wishlist.php/toby