From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Haxby Subject: Re: libxl: build fix Date: Tue, 09 Nov 2010 13:27:05 +0000 Message-ID: <4CD94C29.5010707@oracle.com> References: <201011051608.47100.Christoph.Egger@amd.com> <201011091239.51488.Christoph.Egger@amd.com> <19673.13957.616191.466954@mariner.uk.xensource.com> <201011091358.46837.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201011091358.46837.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 09/11/10 12:58, Christoph Egger wrote: > On Tuesday 09 November 2010 12:54:45 Ian Jackson wrote: >> Christoph Egger writes ("Re: [Xen-devel] libxl: build fix"): >>> Attached patch replaces basename with strrchr(3). >> ... >> >>> - name = basename(filename); >>> + name = strrchr(filename, '/'); > Sorry, should be > > name = strrchr(filename, '/') + 1; > No, it should be name = strrchr(filename, '/'); if (name) name++; else name = filename; In fact even that isn't right because basename(3) discards (or at least ignores) trailing '/' characters. jch