summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin.dahyabhai@pobox.com>2009-05-07 18:39:49 -0400
committerNalin Dahyabhai <nalin.dahyabhai@pobox.com>2009-05-07 18:39:49 -0400
commit8b2c6db1810a65d029c1f604ab7ffeee41cb58ba (patch)
treef48481cfd174611810630560bd148b6df128d064
parent5e48debe2d515c2226492da8bb685101d509efff (diff)
downloadslapi-nis-8b2c6db1810a65d029c1f604ab7ffeee41cb58ba.tar.gz
slapi-nis-8b2c6db1810a65d029c1f604ab7ffeee41cb58ba.tar.xz
slapi-nis-8b2c6db1810a65d029c1f604ab7ffeee41cb58ba.zip
- changes to comments
-rw-r--r--src/format.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/format.c b/src/format.c
index dbe9ed9..aa49cda 100644
--- a/src/format.c
+++ b/src/format.c
@@ -2368,6 +2368,7 @@ format_link(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
/* Walk the lists, building the output data items. */
n_lists = (argc + 1) / 3;
+ /* Count the number of items in each list. */
for (i = 0; i < n_lists; i++) {
for (j = 0;
(values[i] != NULL) && (values[i][j] != NULL);
@@ -2386,10 +2387,10 @@ format_link(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
n_done = 0;
for (i = 0; i < n_lists; i++) {
if (result_n < n_items[i]) {
- /* List has an item for this result. */
+ /* This list has an item for this result. */
length += lengths[i][result_n];
} else {
- /* Use the padding. */
+ /* This list ran out of items -- use padding. */
length += strlen(argv[i * 3 + 1]);
/* Note that this list has run out. */
n_done++;
@@ -2426,12 +2427,12 @@ format_link(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e,
p = buffer;
for (i = 0; i < n_lists; i++) {
if (result_n < n_items[i]) {
- /* The value from the list of values. */
+ /* This list has an item for this result. */
l = lengths[i][result_n];
memcpy(p, values[i][result_n], l);
p += l;
} else {
- /* Padding. */
+ /* This list ran out of items -- use padding. */
l = strlen(argv[i * 3 + 1]);
memcpy(p, argv[i * 3 + 1], l);
p += l;