diff options
author | Roland McGrath <roland@gnu.org> | 1995-09-28 18:47:33 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-09-28 18:47:33 +0000 |
commit | b7b7c6058fb1b23f76a2f8267ab99798dddf591e (patch) | |
tree | 59c36ca33c400e45bc76f2872c63570ef593c81f /boot/boot_script.c | |
parent | c975d9bf504bd32af6c822a8e2980a6feba81acd (diff) |
(read_file): Pass CMD->path for file name.
(CHECK_CMDLINE_LEN): Update ARGV pointers after reallocating the line
buffer.
Diffstat (limited to 'boot/boot_script.c')
-rw-r--r-- | boot/boot_script.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/boot/boot_script.c b/boot/boot_script.c index 56b5f9ab..403988eb 100644 --- a/boot/boot_script.c +++ b/boot/boot_script.c @@ -119,7 +119,7 @@ resume_task (struct cmd *cmd, int *val) static int read_file (struct cmd *cmd, int *val) { - *val = boot_script_read_file (cmd->args[0]); + *val = boot_script_read_file (cmd->path); if (*val == 0) return BOOT_SCRIPT_MACH_ERROR; return 0; @@ -502,7 +502,7 @@ boot_script_parse_line (char *cmdline) if (cmdline_alloc - cmdline_index < len) \ { \ char *ptr; \ - int alloc; \ + int alloc, i; \ alloc = cmdline_alloc + len - (cmdline_alloc - cmdline_index) + 100; \ ptr = boot_script_malloc (alloc); \ if (! ptr) \ @@ -511,6 +511,8 @@ boot_script_parse_line (char *cmdline) goto done; \ } \ memcpy (ptr, cmdline, cmdline_index); \ + for (i = 0; i < argc; ++i) \ + argv[i] = ptr + (argv[i] - cmdline); \ boot_script_free (cmdline, cmdline_alloc); \ cmdline = ptr; \ cmdline_alloc = alloc; \ |