fix decalage deplacement de mots en mots + opt x refonctionne

This commit is contained in:
gwojda 2017-03-24 12:12:38 +01:00
parent b8e3fddce3
commit 0e975eb27f
5 changed files with 13 additions and 6 deletions

View file

@ -6,14 +6,14 @@
# By: wescande <wescande@student.42.fr> +#+ +:+ +#+ # # By: wescande <wescande@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2016/08/29 21:32:58 by wescande #+# #+# # # Created: 2016/08/29 21:32:58 by wescande #+# #+# #
# Updated: 2017/03/23 18:17:44 by jhalford ### ########.fr # # Updated: 2017/03/24 12:02:21 by gwojda ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
NAME = 42sh NAME = 42sh
CC = gcc CC = gcc
FLAGS = -Wall -Wextra -Werror -fvisibility=hidden FLAGS = -Wall -Wextra -Werror #-fvisibility=hidden
D_FLAGS = -g D_FLAGS = -g
DELTA = $$(echo "$$(tput cols)-47"|bc) DELTA = $$(echo "$$(tput cols)-47"|bc)

View file

@ -1 +1,7 @@
echo "echo hello" >> sample/infinite.sh echo "echo hello" >> sample/infinite.sh
echo hello
echo hello
echo hello
echo hello
echo hello
echo hello

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/19 12:45:06 by gwojda #+# #+# */ /* Created: 2016/12/19 12:45:06 by gwojda #+# #+# */
/* Updated: 2017/03/23 16:52:38 by gwojda ### ########.fr */ /* Updated: 2017/03/24 11:57:45 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -44,7 +44,7 @@ int ft_x(char **str, size_t *pos)
++i; ++i;
if (g_cpy[i].value && (ret = g_cpy[i].f(str, pos, pos_ref))) if (g_cpy[i].value && (ret = g_cpy[i].f(str, pos, pos_ref)))
return (0); return (0);
else else if (!g_cpy[i].value)
break ; break ;
} }
if (data_singleton()->line.copy_tmp && *data_singleton()->line.copy_tmp) if (data_singleton()->line.copy_tmp && *data_singleton()->line.copy_tmp)

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/07 11:00:28 by gwojda #+# #+# */ /* Created: 2017/01/07 11:00:28 by gwojda #+# #+# */
/* Updated: 2017/03/21 18:10:50 by gwojda ### ########.fr */ /* Updated: 2017/03/24 11:52:10 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */ /* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/14 11:12:09 by gwojda #+# #+# */ /* Created: 2017/02/14 11:12:09 by gwojda #+# #+# */
/* Updated: 2017/03/17 12:33:43 by gwojda ### ########.fr */ /* Updated: 2017/03/24 12:12:11 by gwojda ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -53,6 +53,7 @@ static void ft_found_prev_word_2(int i, char *str, size_t *pos)
++(*pos); ++(*pos);
} }
(*pos) -= i; (*pos) -= i;
(*pos) -= ((ft_nb_last_line(str, *pos) == 0) ? 1 : 0);
} }
int ft_found_prev_word(char **str, size_t *pos) int ft_found_prev_word(char **str, size_t *pos)