<div dir="ltr"><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br><br></div>Please CC stable.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 8:13 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:timothy.arceri@collabora.com" target="_blank">timothy.arceri@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently its dependant on the user calling and checking the result<br>
of list_empty() before using the result of list_is_singular().<br>
---<br>
src/util/list.h | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/util/list.h b/src/util/list.h<br>
index e8a99ac..07eb9f3 100644<br>
--- a/src/util/list.h<br>
+++ b/src/util/list.h<br>
@@ -110,7 +110,7 @@ static inline bool list_empty(struct list_head *list)<br>
*/<br>
static inline bool list_is_singular(const struct list_head *list)<br>
{<br>
- return list->next != NULL && list->next->next == list;<br>
+ return list->next != NULL && list->next != list && list->next->next == list;<br>
}<br>
<br>
static inline unsigned list_length(struct list_head *list)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>