aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-06-14 19:34:19 +0000
committerDavid Shaw <[email protected]>2002-06-14 19:34:19 +0000
commit7226fdf27a138b5f96b1232e0d8431d97189acd8 (patch)
treee143bca8ffe7d5597044a3ed0f3173045a06f8fa
parent* keyedit.c (show_key_with_all_names): Display warning if a user tries to (diff)
downloadgnupg-7226fdf27a138b5f96b1232e0d8431d97189acd8.tar.gz
gnupg-7226fdf27a138b5f96b1232e0d8431d97189acd8.zip
* strgutil.c (pop_strlist): New function to pop the head off of a strlist.
-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