Deleted Added
full compact
boot.c (40327) boot.c (40775)
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: boot.c,v 1.6 1998/10/11 10:10:41 peter Exp $
26 * $Id: boot.c,v 1.7 1998/10/14 00:41:17 peter Exp $
27 */
28
29/*
30 * Loading modules, booting the system
31 */
32
33#include <stand.h>
34#include <string.h>

--- 163 unchanged lines hidden (view full) ---

198 break;
199 }
200 ntime = time(NULL);
201 if (ntime >= when) {
202 yes = 1;
203 break;
204 }
205 if (ntime != otime) {
27 */
28
29/*
30 * Loading modules, booting the system
31 */
32
33#include <stand.h>
34#include <string.h>

--- 163 unchanged lines hidden (view full) ---

198 break;
199 }
200 ntime = time(NULL);
201 if (ntime >= when) {
202 yes = 1;
203 break;
204 }
205 if (ntime != otime) {
206 printf("\rBooting [%s] in %d seconds...", getbootfile(0), (int)(when - ntime));
206 printf("\rBooting [%s] in %d seconds... ", getbootfile(0), (int)(when - ntime));
207 otime = ntime;
208 cr = 1;
209 }
210 }
207 otime = ntime;
208 cr = 1;
209 }
210 }
211 if (yes)
212 printf("\rBooting [%s]... ", getbootfile(0));
211 if (cr)
212 putchar('\n');
213 if (yes) {
214 argv[0] = "boot";
215 argv[1] = NULL;
216 return(command_boot(1, argv));
217 }
218 return(CMD_OK);

--- 21 unchanged lines hidden (view full) ---

240 if ((spec = getenv("bootfile")) == NULL)
241 spec = default_bootfiles;
242
243 while ((try > 0) && (spec != NULL)) {
244 spec = strchr(spec, ',');
245 try--;
246 }
247 if (spec != NULL) {
213 if (cr)
214 putchar('\n');
215 if (yes) {
216 argv[0] = "boot";
217 argv[1] = NULL;
218 return(command_boot(1, argv));
219 }
220 return(CMD_OK);

--- 21 unchanged lines hidden (view full) ---

242 if ((spec = getenv("bootfile")) == NULL)
243 spec = default_bootfiles;
244
245 while ((try > 0) && (spec != NULL)) {
246 spec = strchr(spec, ',');
247 try--;
248 }
249 if (spec != NULL) {
248 if ((ep = strchr(spec, ',')) != NULL) {
250 if ((ep = strchr(spec, ';')) != NULL) {
249 len = ep - spec;
250 } else {
251 len = strlen(spec);
252 }
253 name = malloc(len + 1);
254 strncpy(name, spec, len);
255 name[len] = 0;
256 }
257 if (name[0] == 0) {
258 free(name);
259 name = NULL;
260 }
261 return(name);
262}
263
251 len = ep - spec;
252 } else {
253 len = strlen(spec);
254 }
255 name = malloc(len + 1);
256 strncpy(name, spec, len);
257 name[len] = 0;
258 }
259 if (name[0] == 0) {
260 free(name);
261 name = NULL;
262 }
263 return(name);
264}
265