mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:15:07 +00:00
Revert "Kernel: Copy command line to a safe place"
This reverts commit 41c005cb14
.
This commit is contained in:
parent
0db7e04c2e
commit
8a21491d86
3 changed files with 4 additions and 22 deletions
|
@ -25,34 +25,21 @@
|
|||
*/
|
||||
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/StdLib.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
static char s_cmd_line[1024];
|
||||
static CommandLine* s_the;
|
||||
|
||||
void CommandLine::early_initialize(const char* cmd_line)
|
||||
{
|
||||
if (!cmd_line)
|
||||
return;
|
||||
size_t length = strlen(cmd_line);
|
||||
if (length >= sizeof(s_cmd_line))
|
||||
length = sizeof(s_cmd_line) -1;
|
||||
memcpy(s_cmd_line, cmd_line, length);
|
||||
s_cmd_line[length] = '\0';
|
||||
}
|
||||
|
||||
const CommandLine& kernel_command_line()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
void CommandLine::initialize()
|
||||
void CommandLine::initialize(const String& string)
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
s_the = new CommandLine(s_cmd_line);
|
||||
s_the = new CommandLine(string);
|
||||
}
|
||||
|
||||
CommandLine::CommandLine(const String& string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue