aboutsummaryrefslogtreecommitdiffstats
path: root/uid.c
diff options
context:
space:
mode:
Diffstat (limited to 'uid.c')
-rw-r--r--uid.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/uid.c b/uid.c
index 000c0233..50d8ede6 100644
--- a/uid.c
+++ b/uid.c
@@ -197,6 +197,19 @@ int str_nr_in_list( struct idlist **idl, const char *str )
return -1;
}
+int str_nr_last_in_list( struct idlist **idl, const char *str )
+ /* return the last position of str in idl */
+{
+ int nr, ret = -1;
+ struct idlist *walk;
+ if ( !str )
+ return -1;
+ for( walk = *idl, nr = 0; walk; nr ++, walk = walk->next )
+ if( strcasecmp( str, walk->id) == 0 )
+ ret = nr;
+ return ret;
+}
+
int count_list( struct idlist **idl )
/* count the number of elements in the list */
{