mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 11:26:51 +01:00
「🔨」 fix: fixed ./{file}
This commit is contained in:
@ -6,11 +6,12 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/05/25 15:06:15 by adjoly #+# #+# */
|
/* Created: 2024/05/25 15:06:15 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/15 14:12:50 by adjoly ### ########.fr */
|
/* Updated: 2024/07/15 16:22:01 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
t_redirection *__to_redir(char *redir_s)
|
t_redirection *__to_redir(char *redir_s)
|
||||||
{
|
{
|
||||||
@ -29,10 +30,9 @@ t_redirection *__to_redir(char *redir_s)
|
|||||||
tmp = redir_s;
|
tmp = redir_s;
|
||||||
if (!ft_isalnum(*tmp) && *tmp != '/' && *tmp != '.')
|
if (!ft_isalnum(*tmp) && *tmp != '/' && *tmp != '.')
|
||||||
return (redir);
|
return (redir);
|
||||||
while (*tmp && ft_isalnum(*tmp) && *tmp != '/' && *tmp != '.')
|
while (*tmp && (ft_isalnum(*tmp) || *tmp == '/' || *tmp == '.'))
|
||||||
tmp++;
|
tmp++;
|
||||||
redir->file_name = ft_calloc(tmp - redir_s + 1, sizeof(char));
|
redir->file_name = ft_calloc(tmp - redir_s + 1, sizeof(char));
|
||||||
ft_strlcpy(redir->file_name, redir_s, tmp - redir_s + 1);
|
ft_strlcpy(redir->file_name, redir_s, tmp - redir_s + 1);
|
||||||
redir_s += (tmp - redir_s);
|
|
||||||
return (redir);
|
return (redir);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user