Module Name: src
Committed By: christos
Date: Sun Jun 24 19:53:35 UTC 2018
Modified Files:
src/usr.sbin/sysinst: util.c
Log Message:
Revert previous, fix iteration loops to be consistent:
All sets that have an id >= SET_LAST have NULL name, so use that like the
loop just below.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/util.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.10 src/usr.sbin/sysinst/util.c:1.11
--- src/usr.sbin/sysinst/util.c:1.10 Sat Jun 23 18:35:29 2018
+++ src/usr.sbin/sysinst/util.c Sun Jun 24 15:53:35 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: util.c,v 1.10 2018/06/23 22:35:29 kamil Exp $ */
+/* $NetBSD: util.c,v 1.11 2018/06/24 19:53:35 christos Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -78,7 +78,7 @@ static const char *msg_yes, *msg_no, *ms
static const char *msg_cur_distsets_row;
static int select_menu_width;
-static uint8_t set_status[SET_GROUP_END + 1];
+static uint8_t set_status[SET_GROUP_END];
#define SET_VALID 0x01
#define SET_SELECTED 0x02
#define SET_SKIPPED 0x04
@@ -1010,16 +1010,15 @@ get_and_unpack_sets(int update, msg setu
/* Accurately count selected sets */
for (dist = dist_list; (set = dist->set) != SET_LAST; dist++) {
+ if (dist->name == NULL)
+ continue;
if ((set_status[set] & (SET_VALID | SET_SELECTED))
== (SET_VALID | SET_SELECTED))
tarstats.nselected++;
}
status = SET_RETRY;
- for (dist = dist_list; ; dist++) {
- set = dist->set;
- if (set == SET_LAST)
- break;
+ for (dist = dist_list; (set = dist->set) != SET_LAST; dist++) {
if (dist->name == NULL)
continue;
if (set_status[set] != (SET_VALID | SET_SELECTED))