From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11364 Path: news.gmane.org!.POSTED!not-for-mail From: Julien Ramseier Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] glob: fix / matching Date: Sun, 28 May 2017 17:06:45 +0200 Message-ID: References: <20170528015918.GC1627@brightrain.aerifal.cx> <20170528025520.GF1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_4830676A-9D44-426B-BC07-B14C2BC5AA04" X-Trace: blaine.gmane.org 1495984022 1869 195.159.176.226 (28 May 2017 15:07:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 May 2017 15:07:02 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11379-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 28 17:06:59 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dEzmU-0000PY-LW for gllmg-musl@m.gmane.org; Sun, 28 May 2017 17:06:58 +0200 Original-Received: (qmail 30533 invoked by uid 550); 28 May 2017 15:06:59 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30503 invoked from network); 28 May 2017 15:06:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:references:to:in-reply-to; bh=mb4pZLqaYvnJp3OzrDqM8jJVKvKZ7+WXwGBDcAHigbE=; b=NC+oWFe+OZWyjLbBI78ZLVBmlpXDUZkTG6UPAhAYN4LQW1aMlecXzenkJnqRa5QTOi nRGCkM8j0xUw49pHOw+/whgmGPNAA898Riv2q3JKuDJ4Q/WhZat0JeN8SjEeyctvwawV a6l8OQQS61kpq8NVRGP5vsgkBVbQWQxa/aPF3ZAv8hCIIh1y+pkS3hpbvo98/QZAWEaC WZCTT+cGcUdEuIhQlAVMJP0P0S4Wv3NJFj/SwtXIQdF6cnVvIF4MT3lBsMuIQAixkQwV jmpGVOyMkA4NcQuPb4mV9g7ruc8SSExEVPzimAoA9OTqYb8DRbM677Xk9NjKmFQTiII6 gELw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :references:to:in-reply-to; bh=mb4pZLqaYvnJp3OzrDqM8jJVKvKZ7+WXwGBDcAHigbE=; b=mkPgyChnqRCxbH4s+5OqENCLZr85nfW6yxAsqvu3WHBIyBzVzPb8TFgg1UAJYmLVE0 TTfpOJ05m15kmG0KSnZKeMz3sDGmffuYbLsBSn8cD2cV74keLC2uRXkgT/H7q9cKrHJP g3Awte0SPqpOPJ+FdcjvyZHfLYPgBWGxAU4XRI1S9PaItv7Yyg1ZN6lK1ChzWRCESIRT gQISu/YBrql2p3JcoJoIkJkTs+gQjywsfVu30T91X+ZCnZLVRXig/xNBb2pW3QbLud3m K0mWZeDYqQMKQCsNvSk9YodTY7ELCGHlB00aM99yiKwODBYObQ4gZ9IvAojognpFvbIP 0xFw== X-Gm-Message-State: AODbwcD6/+JNgIf8QmmpsKgOspy6Ry9/Iq2S6rYnoBpy6K9cZZe2DiGX XpHt03FdD2xdoCKUMaU= X-Received: by 10.80.154.197 with SMTP id p63mr9402056edb.59.1495984007578; Sun, 28 May 2017 08:06:47 -0700 (PDT) In-Reply-To: <20170528025520.GF1627@brightrain.aerifal.cx> X-Mailer: Apple Mail (2.3124) Xref: news.gmane.org gmane.linux.lib.musl.general:11364 Archived-At: --Apple-Mail=_4830676A-9D44-426B-BC07-B14C2BC5AA04 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 28 mai 2017 =C3=A0 04:55, Rich Felker a =C3=A9crit = : >>=20 >> I'm confused how this patch differs from just removing the "if (*p)" >> condition before calling match_in_dir. Does match_in_dir actually = work >> if p points to an empty string? I thought not... >=20 > Hmm, just removing the "if (*p)" seems to make it work; it looks like > match_in_dir covers this case fine. I'd like a second opinion on > whether this looks okay since I haven't touched this code in years, > but I suspect it'll turn out to be an okay fix for now... >=20 The "if (*p)" is needed, otherwise match_in_dir will append an empty match when p =3D "".=20 - Julien= --Apple-Mail=_4830676A-9D44-426B-BC07-B14C2BC5AA04 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Le 28 mai 2017 =C3=A0 04:55, Rich Felker <dalias@libc.org> a = =C3=A9crit :

I'm = confused how this patch differs from just removing the "if (*p)"
condition before calling match_in_dir. Does match_in_dir = actually work
if p points to an empty string? I thought = not...

Hmm, just removing the "if (*p)" = seems to make it work; it looks like
match_in_dir covers this case = fine. I'd like a second opinion on
whether this looks okay since I = haven't touched this code in years,
but I suspect it'll turn out to = be an okay fix for now...


The "if (*p)" is needed, otherwise match_in_dir = will append an empty
match when p =3D "". 

- Julien
= --Apple-Mail=_4830676A-9D44-426B-BC07-B14C2BC5AA04--