aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty/command.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-09-20 00:46:03 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-09-20 00:57:33 +0200
commit00b5ed3d921f2f39e60ed372809c33b8bce78ad8 (patch)
tree2b8e29114e485853dd3ec9c58a801493d9eac8fb /src/vty/command.c
parent430636328c2fbd9fffc0eac5114462c200b7f2cb (diff)
comment: describe indent_cmp()
Diffstat (limited to 'src/vty/command.c')
-rw-r--r--src/vty/command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index 46c9fa28..a19d5db9 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2331,6 +2331,10 @@ static inline size_t len(const char *str)
return str? strlen(str) : 0;
}
+/*! Make sure the common length of strings a and b is identical, then compare their lengths. I.e., if a
+ * is longer than b, a must start with exactly b, and vice versa.
+ * \returns EINVAL on mismatch, -1 for a < b, 0 for a == b, 1 for a > b.
+ */
static int indent_cmp(const char *a, const char *b)
{
size_t al, bl;