libbb: add a comment describing the way is_prefixed_with() works
authorBartosz Golaszewski <bartekgola@gmail.com>
Tue, 25 Aug 2015 11:10:00 +0000 (13:10 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Aug 2015 13:04:16 +0000 (15:04 +0200)
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/compare_string_array.c

index 450916c3a985e74ce205affeab798fc50031e9da..cdcb2718d450ab448cc3ae8ee027b0533c0f1aa6 100644 (file)
@@ -5,6 +5,11 @@
 
 #include "libbb.h"
 
+/*
+ * Return NULL if string is not prefixed with key. Return pointer to the
+ * first character in string after the prefix key. If key is an empty string,
+ * return pointer to the beginning of string.
+ */
 char* FAST_FUNC is_prefixed_with(const char *string, const char *key)
 {
 #if 0  /* Two passes over key - probably slower */