From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW8cO-00085X-JP for qemu-devel@nongnu.org; Thu, 12 Mar 2015 15:18:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YW8cD-0001Bc-EU for qemu-devel@nongnu.org; Thu, 12 Mar 2015 15:18:04 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:37804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW8cC-0001B2-SB for qemu-devel@nongnu.org; Thu, 12 Mar 2015 15:17:53 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Mar 2015 00:47:48 +0530 From: "Aneesh Kumar K.V" In-Reply-To: <1426143150-5641-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1426143150-5641-1-git-send-email-mjt@msgid.tls.msk.ru> Date: Thu, 12 Mar 2015 15:23:55 +0530 Message-ID: <8761a6bky4.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] 9pfs-local: simplify/optimize local_mapped_attr_path() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org Michael Tokarev writes: > Omit one unnecessary memory allocation for components > of the path and create the resulting path directly given > lengths of the components. > > Do not use basename(3) because there are 2 versions of > this function which differs when argument ends with > slash character, use strrchr() instead so we have > consistent result. This also makes sure the function > will do the right thing in corner cases (eg, empty > pathname is given), when basename(3) return entirely > another string. > > Signed-off-by: Michael Tokarev Applied. Thanks -aneesh