summaryrefslogtreecommitdiffstats
path: root/jnlib/strlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'jnlib/strlist.c')
-rw-r--r--jnlib/strlist.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/jnlib/strlist.c b/jnlib/strlist.c
index 7cbaf5e02..063c89c7e 100644
--- a/jnlib/strlist.c
+++ b/jnlib/strlist.c
@@ -56,7 +56,7 @@ add_to_strlist( STRLIST *list, const char *string )
#if 0
/****************
* same as add_to_strlist() but if is_utf8 is *not* set a conversion
- * to UTF8 is done
+ * to UTF8 is done
*/
STRLIST
add_to_strlist2( STRLIST *list, const char *string, int is_utf8 )
@@ -130,4 +130,22 @@ strlist_last( STRLIST node )
}
+char *
+strlist_pop (STRLIST *list)
+{
+ char *str=NULL;
+ STRLIST sl=*list;
+
+ if(sl)
+ {
+ str=jnlib_xmalloc(strlen(sl->d)+1);
+ strcpy(str,sl->d);
+
+ *list=sl->next;
+ jnlib_free(sl);
+ }
+
+ return str;
+}
+