mirror of
https://github.com/Savapitech/42sh.git
synced 2026-03-18 21:50:35 +01:00
[FIX] coding style
This commit is contained in:
@@ -126,7 +126,7 @@ static char *get_last_word(char *str)
|
||||
if (!str)
|
||||
return NULL;
|
||||
while (str[x] != '\0') {
|
||||
if(isblank(str[x]))
|
||||
if (isblank(str[x]))
|
||||
last_space = x + 1;
|
||||
x++;
|
||||
}
|
||||
|
||||
@@ -15,10 +15,11 @@ int builtins_history(ef_t *ef, char **args __attribute__((unused)))
|
||||
his_command_t *cmd_history = ef->builtin_handler->history_command;
|
||||
|
||||
for (int i = 0; i < cmd_history->sz; i++){
|
||||
if (cmd_history[i].arg)
|
||||
printf("%d %s %s\n", i, cmd_history[i].command, cmd_history[i].arg);
|
||||
else
|
||||
if (cmd_history[i].arg) {
|
||||
printf("%d %s %s\n", i, cmd_history[i].command,
|
||||
cmd_history[i].arg);
|
||||
} else
|
||||
printf("%d %s\n", i, cmd_history[i].command);
|
||||
}
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ int cmd_history_is_in(char *line)
|
||||
{
|
||||
for (int i = 0; line[i] != 0; i++)
|
||||
if (line[i] == CHAR_HIST &&
|
||||
(line[i + 1] != ' ' && line[i + 1] != '\t'
|
||||
(line[i + 1] != ' ' && line[i + 1] != '\t'
|
||||
&& line[i + 1] != '\0'))
|
||||
return 0;
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user