From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E625347512 for ; Thu, 26 Mar 2026 02:25:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774491935; cv=none; b=rDXfaXoip+grg8GKpbRI6cOJvliuM4bQDD7qhIqoHBcFxkr2R9jra5nGbNiQaLqEt60MRP+dsdJkvVy9zGkFiHKjOUa64RM5GVyT54lHyeQCvr68Zb+j5Rc0MmWCm5FKdQvQYg8tpggn83vhSOWaZRU0OaCimpA9LzMjz7YX3fc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774491935; c=relaxed/simple; bh=EFB9IiuKroD2vBjeNZdUIt71Wanfm8+UVWhG81ndgvk=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=sGGT6hO0sFiwvtkAoxczXBWIGWH0q5B4x60O/RFPY+vd4YJIwJxJ0dsSlHpFKGKBv5xqYNHi8MDEX9imlF5n/M5P5xGblpyd/p4NFUkwqnVlXyoj3fHoR1QbZU0IsuvYex4Gi2uXnn7O20VB+QgWXu+X2+NhtUjVNoN2Unqu0QQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=u2TUVgWV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="u2TUVgWV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 090FDC4CEF7; Thu, 26 Mar 2026 02:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774491935; bh=EFB9IiuKroD2vBjeNZdUIt71Wanfm8+UVWhG81ndgvk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=u2TUVgWVlC+gLaMpW5g4vE8bdA+PRTP6uTLZmUSs9R5QhesalvI8RMpe2KwGQHd1A EFw6NqHNFOZ6mY/ksqf9b9wWV9yfhdC0RyQON11g+a6qEZ8R+v19KGMVufv/vKGp6U RIYmnBZTwx8bAX2VR85e8HqcRyhj+2Izsni5XVq4= Date: Wed, 25 Mar 2026 19:25:34 -0700 From: Andrew Morton To: Inseob Kim Cc: linux-kernel@vger.kernel.org, changbin.du@gmail.com, jbaron@akamai.com, joe@perches.com, Josh Law Subject: Re: [PATCH v2] lib: parser: Fix match_wildcard to correctly handle trailing stars Message-Id: <20260325192534.151e86e439e7e4080a630d4c@linux-foundation.org> In-Reply-To: <20260326020630.4139520-1-inseob@google.com> References: <20260326020630.4139520-1-inseob@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 26 Mar 2026 11:06:04 +0900 Inseob Kim wrote: > This fixes a bug of match_wildcard that incorrectly handles trailing > asterisks. For example, `match_wildcard("abc**", "abc")` must return > true, but it returns false. > > Signed-off-by: Inseob Kim > --- > v2: > - Added Cc. No changes to the code. > --- > lib/parser.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/parser.c b/lib/parser.c > index 73e8f8e5be73..62da0ac0d438 100644 > --- a/lib/parser.c > +++ b/lib/parser.c > @@ -315,7 +315,7 @@ bool match_wildcard(const char *pattern, const char *str) > } > } > > - if (*p == '*') > + while (*p == '*') > ++p; > return !*p; > } Thanks, looks right. We don't appear to have any selftesting for this code. Should all of parser.c actually exist? Some of it is a subset of lib/glob.c?