[prev in list] [next in list] [prev in thread] [next in thread] 

List:       musl
Subject:    Re: [musl] [PATCH] glob: fix / matching
From:       Julien Ramseier <j.ramseier () gmail ! com>
Date:       2017-05-28 15:06:45
Message-ID: CE23B1E4-CE43-43D9-B8B6-E3876267DE42 () gmail ! com
[Download RAW message or body]

> Le 28 mai 2017 à 04:55, Rich Felker <dalias@libc.org> a écrit :
>> 
>> 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 = "". 

- Julien
[Attachment #3 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote \
type="cite" class=""><div class="">Le 28 mai 2017 Ã  04:55, Rich Felker &lt;<a \
href="mailto:dalias@libc.org" class="">dalias@libc.org</a>&gt; a écrit :</div><div \
class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: \
0px;" class=""><br class="">I'm confused how this patch differs from just removing \
the "if (*p)"<br class="">condition before calling match_in_dir. Does match_in_dir \
actually work<br class="">if p points to an empty string? I thought not...<br \
class=""></blockquote><br style="font-family: Menlo-Regular; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: \
0px;" class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: \
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; \
orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
float: none; display: inline !important;" class="">Hmm, just removing the "if (*p)" \
seems to make it work; it looks like</span><br style="font-family: Menlo-Regular; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; \
-webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; float: none; display: inline !important;" \
class="">match_in_dir covers this case fine. I'd like a second opinion on</span><br \
style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; \
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: \
auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; \
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span \
style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; \
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: \
auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; \
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; \
display: inline !important;" class="">whether this looks okay since I haven't touched \
this code in years,</span><br style="font-family: Menlo-Regular; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: \
0px;" class=""><span style="font-family: Menlo-Regular; font-size: 12px; font-style: \
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; \
orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
float: none; display: inline !important;" class="">but I suspect it'll turn out to be \
an okay fix for now...</span><br style="font-family: Menlo-Regular; font-size: 12px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: \
0px;" class=""><br class=""></div></blockquote></div><div><br class=""></div><div>The \
"if (*p)" is needed, otherwise match_in_dir will append an empty</div><div>match when \
p = "".&nbsp;</div><br class=""><div class="">- Julien</div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic