mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 07:19:20 +00:00
Update kernel
This commit is contained in:
@ -22,26 +22,26 @@
|
||||
|
||||
void targp_parse(const char *cmd, char **argv, int *argc)
|
||||
{
|
||||
const char delim[] = " ";
|
||||
const char delim[] = " ";
|
||||
|
||||
char *token = strtok((char *)cmd, delim);
|
||||
while (token != NULL)
|
||||
{
|
||||
char *quote = strchr(token, '"');
|
||||
if (quote != NULL)
|
||||
{
|
||||
memmove(quote, quote + 1, strlen(quote));
|
||||
char *endQuote = strchr(quote, '"');
|
||||
if (endQuote != NULL)
|
||||
*endQuote = '\0';
|
||||
}
|
||||
char *token = strtok((char *)cmd, delim);
|
||||
while (token != NULL)
|
||||
{
|
||||
char *quote = strchr(token, '"');
|
||||
if (quote != NULL)
|
||||
{
|
||||
memmove(quote, quote + 1, strlen(quote));
|
||||
char *endQuote = strchr(quote, '"');
|
||||
if (endQuote != NULL)
|
||||
*endQuote = '\0';
|
||||
}
|
||||
|
||||
char *arg = (char *)kmalloc(strlen(token) + 1);
|
||||
strcpy(arg, token);
|
||||
char *arg = (char *)kmalloc(strlen(token) + 1);
|
||||
strcpy(arg, token);
|
||||
|
||||
argv[(*argc)++] = arg;
|
||||
argv[(*argc)++] = arg;
|
||||
|
||||
token = strtok(NULL, delim);
|
||||
}
|
||||
argv[(*argc)] = NULL;
|
||||
token = strtok(NULL, delim);
|
||||
}
|
||||
argv[(*argc)] = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user