From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRSMR-0002AN-Gp for qemu-devel@nongnu.org; Thu, 04 Feb 2016 17:26:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRSMN-0004pM-Ax for qemu-devel@nongnu.org; Thu, 04 Feb 2016 17:26:47 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRSMN-0004pC-75 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 17:26:43 -0500 Received: by mail-qk0-x241.google.com with SMTP id q184so1729982qkb.0 for ; Thu, 04 Feb 2016 14:26:43 -0800 (PST) Sender: Richard Henderson References: <1454597781-18115-1-git-send-email-alex.bennee@linaro.org> <1454597781-18115-6-git-send-email-alex.bennee@linaro.org> From: Richard Henderson Message-ID: <56B3D01C.9080405@twiddle.net> Date: Fri, 5 Feb 2016 09:26:36 +1100 MIME-Version: 1.0 In-Reply-To: <1454597781-18115-6-git-send-email-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v5 5/9] qemu-log: support simple pid substitution in logfile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, crosthwaitepeter@gmail.com, dgilbert@redhat.com, aurelien@aurel32.net, peter.maydell@linaro.org On 02/05/2016 01:56 AM, Alex Bennée wrote: > + if (g_strrstr(filename, "%d")) { > + /* if we are going to format this we'd better validate first */ > + if (g_regex_match_simple("^[^%]+%d[^%]+$", filename, 0, 0)) { Why g_strrstr instead of strstr? There should be only one, so why look for the last? r~