aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/ChangeLog5
-rw-r--r--util/strgutil.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/util/ChangeLog b/util/ChangeLog
index 27245a78d..ec4a285b9 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-14 David Shaw <[email protected]>
+
+ * strgutil.c (pop_strlist): New function to pop the head off of a
+ strlist.
+
2002-06-05 Timo Schulz <[email protected]>
* fileutil.c (is_file_compressed): Corrected the magic values
diff --git a/util/strgutil.c b/util/strgutil.c
index 6ad434006..ff1ff5126 100644
--- a/util/strgutil.c
+++ b/util/strgutil.c
@@ -168,7 +168,23 @@ strlist_last( STRLIST node )
return node;
}
+char *
+pop_strlist( STRLIST *list )
+{
+ char *str=NULL;
+ STRLIST sl=*list;
+
+ if(sl)
+ {
+ str=m_alloc(strlen(sl->d)+1);
+ strcpy(str,sl->d);
+ *list=sl->next;
+ m_free(sl);
+ }
+
+ return str;
+}
/****************
* look for the substring SUB in buffer and return a pointer to that