From 0e975eb27f97e34af8929dcc4c7f0e6ed44d4b36 Mon Sep 17 00:00:00 2001 From: gwojda Date: Fri, 24 Mar 2017 12:12:38 +0100 Subject: [PATCH] fix decalage deplacement de mots en mots + opt x refonctionne --- 42sh/Makefile | 4 ++-- 42sh/sample/infinite.sh | 6 ++++++ 42sh/src/line_editing/copy_cut_paste/copy_cut_paste.c | 4 ++-- 42sh/src/line_editing/lib_line_editing/toolz2.c | 2 +- 42sh/src/line_editing/move_term/move_to_word.c | 3 ++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/42sh/Makefile b/42sh/Makefile index 50dac7ab..5e78833d 100644 --- a/42sh/Makefile +++ b/42sh/Makefile @@ -6,14 +6,14 @@ # 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 CC = gcc -FLAGS = -Wall -Wextra -Werror -fvisibility=hidden +FLAGS = -Wall -Wextra -Werror #-fvisibility=hidden D_FLAGS = -g DELTA = $$(echo "$$(tput cols)-47"|bc) diff --git a/42sh/sample/infinite.sh b/42sh/sample/infinite.sh index 4e3d731d..90ac1360 100644 --- a/42sh/sample/infinite.sh +++ b/42sh/sample/infinite.sh @@ -1 +1,7 @@ echo "echo hello" >> sample/infinite.sh +echo hello +echo hello +echo hello +echo hello +echo hello +echo hello diff --git a/42sh/src/line_editing/copy_cut_paste/copy_cut_paste.c b/42sh/src/line_editing/copy_cut_paste/copy_cut_paste.c index 1d4cbf84..cec171fb 100644 --- a/42sh/src/line_editing/copy_cut_paste/copy_cut_paste.c +++ b/42sh/src/line_editing/copy_cut_paste/copy_cut_paste.c @@ -6,7 +6,7 @@ /* 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; if (g_cpy[i].value && (ret = g_cpy[i].f(str, pos, pos_ref))) return (0); - else + else if (!g_cpy[i].value) break ; } if (data_singleton()->line.copy_tmp && *data_singleton()->line.copy_tmp) diff --git a/42sh/src/line_editing/lib_line_editing/toolz2.c b/42sh/src/line_editing/lib_line_editing/toolz2.c index 8c531975..fbbc471e 100644 --- a/42sh/src/line_editing/lib_line_editing/toolz2.c +++ b/42sh/src/line_editing/lib_line_editing/toolz2.c @@ -6,7 +6,7 @@ /* 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 */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/line_editing/move_term/move_to_word.c b/42sh/src/line_editing/move_term/move_to_word.c index dade6941..cd0d90ab 100644 --- a/42sh/src/line_editing/move_term/move_to_word.c +++ b/42sh/src/line_editing/move_term/move_to_word.c @@ -6,7 +6,7 @@ /* 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) -= i; + (*pos) -= ((ft_nb_last_line(str, *pos) == 0) ? 1 : 0); } int ft_found_prev_word(char **str, size_t *pos)