From bc5789665ae8c9f8fc3d02841cd6c9ade447a12a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 11 Feb 1998 23:22:09 +0000 Subject: bug fixes --- util/strgutil.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'util/strgutil.c') diff --git a/util/strgutil.c b/util/strgutil.c index a687d0af3..e04367a7e 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -50,6 +50,28 @@ add_to_strlist( STRLIST *list, const char *string ) *list = sl; } + + +STRLIST +strlist_prev( STRLIST head, STRLIST node ) +{ + STRLIST n; + + for(n=NULL; head && head != node; head = head->next ) + n = head; + return n; +} + +STRLIST +strlist_last( STRLIST node ) +{ + if( node ) + for( ; node->next ; node = node->next ) + ; + return node; +} + + /**************** * look for the substring SUB in buffer and return a pointer to that * substring in BUF or NULL if not found. -- cgit v1.2.3