mirror of
https://github.com/zoriya/ash.git
synced 2026-05-25 23:59:37 +00:00
inhibitors working but pre process made by aliases makes some limits
This commit is contained in:
@@ -14,4 +14,5 @@ typedef struct parser_map {
|
||||
int (*parser)(char *, char **);
|
||||
} parser_map;
|
||||
|
||||
char **parse_input(char *cmd);
|
||||
int parse_quotes(char *ptr, char **data);
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
#include "redirections.h"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <string.h>
|
||||
@@ -77,7 +78,7 @@ char **parse_input(char *cmd)
|
||||
new = strndup(ptr, inc);
|
||||
if (!new)
|
||||
return (NULL);
|
||||
new[strlen(new) - 1] = '\0';
|
||||
new[inc - 1] = '\0';
|
||||
ret[ret_inc++] = new;
|
||||
ptr = cmd + i + 1;
|
||||
inc = 0;
|
||||
|
||||
+7
-1
@@ -10,6 +10,7 @@
|
||||
#include "shell.h"
|
||||
#include "builtin.h"
|
||||
#include "redirections.h"
|
||||
#include "parser.h"
|
||||
#include "utility.h"
|
||||
#include <unistd.h>
|
||||
#include <malloc.h>
|
||||
@@ -32,8 +33,13 @@ const builtin builtins[] = {
|
||||
|
||||
int prompt_run(char *cmd, redirection *inout[2], env_t *env)
|
||||
{
|
||||
char **argv = get_argv(cmd);
|
||||
//char **argv = get_argv(cmd);
|
||||
char **argv = parse_input(cmd);
|
||||
|
||||
for (int i = 0; argv[i]; i++) {
|
||||
printf("'%s'\n", argv[i]);
|
||||
}
|
||||
return (0);
|
||||
if (!argv) {
|
||||
perror("mysh");
|
||||
return (-1);
|
||||
|
||||
Reference in New Issue
Block a user