Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pmax/stand/scsiboot Make the bootpath "N/rzY" with ...



details:   https://anonhg.NetBSD.org/src/rev/b30645d38bdf
branches:  trunk
changeset: 471817:b30645d38bdf
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Apr 12 05:14:51 1999 +0000

description:
Make the bootpath "N/rzY" with no trailing '/' valid by adding the extra
'/' before appending 'boot' to the path.

diffstat:

 sys/arch/pmax/stand/scsiboot/bootxx.c |  26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diffs (48 lines):

diff -r ada21bc524e6 -r b30645d38bdf sys/arch/pmax/stand/scsiboot/bootxx.c
--- a/sys/arch/pmax/stand/scsiboot/bootxx.c     Mon Apr 12 04:31:55 1999 +0000
+++ b/sys/arch/pmax/stand/scsiboot/bootxx.c     Mon Apr 12 05:14:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootxx.c,v 1.18 1999/04/11 04:08:25 simonb Exp $       */
+/*     $NetBSD: bootxx.c,v 1.19 1999/04/12 05:14:51 simonb Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -136,22 +136,30 @@
 loadfile(fname)
        char *fname;
 {
-       int fd, i, n;
-       char *buf;
+       int fd, i;
+       char c, *buf, bootfname[64];
        Elf32_Ehdr ehdr;
        Elf32_Phdr phdr;
-       char bootfname[64];
 
        strcpy(bootfname, fname);
        buf = bootfname;
-       while ((n = *buf++) != '\0') {
-               if (n == ')')
+       while ((c = *buf++) != '\0') {
+               if (c == ')')
                        break;
-               if (n != '/')
+               if (c != '/')
                        continue;
-               while ((n = *buf++) != '\0')
-                       if (n == '/')
+               while ((c = *buf++) != '\0')
+                       if (c == '/')
                                break;
+               /*
+                * Make "N/rzY" with no trailing '/' valid by adding
+                * the extra '/' before appending 'boot' to the path.
+                */
+               if (c != '/') {
+                       buf--;
+                       *buf++ = '/';
+                       *buf = '\0';
+               }
                break;
        }
        strcpy(buf, "boot");



Home | Main Index | Thread Index | Old Index