Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst PR 54423: fix handling of user defined part...



details:   https://anonhg.NetBSD.org/src/rev/570f3ae8b8dc
branches:  trunk
changeset: 458581:570f3ae8b8dc
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Aug 01 16:48:06 2019 +0000

description:
PR 54423: fix handling of user defined partitions

diffstat:

 usr.sbin/sysinst/bsddisklabel.c |  37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diffs (60 lines):

diff -r 1b0c2e6acffb -r 570f3ae8b8dc usr.sbin/sysinst/bsddisklabel.c
--- a/usr.sbin/sysinst/bsddisklabel.c   Thu Aug 01 16:32:06 2019 +0000
+++ b/usr.sbin/sysinst/bsddisklabel.c   Thu Aug 01 16:48:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bsddisklabel.c,v 1.23 2019/07/28 16:30:36 martin Exp $ */
+/*     $NetBSD: bsddisklabel.c,v 1.24 2019/08/01 16:48:06 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -365,24 +365,25 @@
                        /* we need absolute mount paths */
                        memmove(new_mp+1, new_mp, sizeof(new_mp)-1);
                        new_mp[0] = '/';
-                       /* duplicates? */
-                       bool duplicate = false;
-                       for (size_t i = 0; i < pset->num; i++) {
-                               if (strcmp(pset->infos[i].mount,
-                                   new_mp) == 0) {
-                                       args = new_mp;
-                                       err = str_arg_subst(
-                                           msg_string(MSG_mp_already_exists),
-                                           1, &args);
-                                       err_msg_win(err);
-                                       free(err);
-                                       duplicate = true;
-                                       break;
-                               }
+               }
+
+               /* duplicates? */
+               bool duplicate = false;
+               for (size_t i = 0; i < pset->num; i++) {
+                       if (strcmp(pset->infos[i].mount,
+                           new_mp) == 0) {
+                               args = new_mp;
+                               err = str_arg_subst(
+                                   msg_string(MSG_mp_already_exists),
+                                   1, &args);
+                               err_msg_win(err);
+                               free(err);
+                               duplicate = true;
+                               break;
                        }
-                       if (!duplicate)
-                               break;
                }
+               if (!duplicate)
+                       break;
        }
 
        m = realloc(pset->menu_opts, (pset->num+4)*sizeof(*pset->menu_opts));
@@ -400,6 +401,8 @@
        p += pset->num;
        memset(m, 0, sizeof(*m));
        memset(p, 0, sizeof(*p));
+       p->cur_part_id = NO_PART;
+       p->type = PT_root;
        strncpy(p->mount, new_mp, sizeof(p->mount));
 
        menu->cursel = pset->num;



Home | Main Index | Thread Index | Old Index