Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24381 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39290 invoked by uid 1010); 14 Jul 2006 20:10:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39269 invoked from network); 14 Jul 2006 20:10:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2006 20:10:47 -0000 X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.42 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from ([195.226.6.42:50681] helo=darkcity.gna.ch) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 07/2B-41830-EF9F7B44 for ; Fri, 14 Jul 2006 16:09:35 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 8E965A0728; Fri, 14 Jul 2006 22:09:31 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XX5CqR9L; Fri, 14 Jul 2006 22:09:30 +0200 (CEST) Received: from [192.168.1.45] (217-162-171-242.dclient.hispeed.ch [217.162.171.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id F0B7595438; Fri, 14 Jul 2006 22:09:29 +0200 (CEST) Message-ID: <44B7F9F8.7010201@cschneid.com> Date: Fri, 14 Jul 2006 22:09:28 +0200 User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060530) MIME-Version: 1.0 To: Tobias Schlitt CC: internals@lists.php.net References: <44B7F0E8.1080001@schlitt.info> In-Reply-To: <44B7F0E8.1080001@schlitt.info> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: Tiny pathinfo() patch From: cschneid@cschneid.com (Christian Schneider) 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. - Chris