]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/slists.h
UCW::CGI: Documented the changes
[libucw.git] / ucw / slists.h
index 5c6d29f93721ea256bd6b66efb2d57d457c891b1..30089ac7c7c05252f965dfc146f974849152c7b4 100644 (file)
@@ -116,9 +116,12 @@ static inline void slist_remove_after(slist *l, snode *after)
 /**
  * Remove the first node in @l. The list can be empty.
  **/
-static inline void slist_remove_head(slist *l)
+static inline void *slist_remove_head(slist *l)
 {
-  slist_remove_after(l, &l->head);
+  snode *n = slist_head(l);
+  if (n)
+    slist_remove_after(l, &l->head);
+  return n;
 }
 
 /* Loops */