From c53ea70cbdbd05c03ffe1bd7e062a60f4f65fbf7 Mon Sep 17 00:00:00 2001 From: gwojda Date: Thu, 23 Mar 2017 00:06:38 +0100 Subject: [PATCH] #157 --- 42sh/Makefile | 4 ++-- 42sh/src/completion/c_match_glob.c | 4 ++-- 42sh/src/line_editing/copy_cut_paste.c | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/42sh/Makefile b/42sh/Makefile index b2a8cb9a..ada8c6ad 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/22 14:59:33 by gwojda ### ########.fr # +# Updated: 2017/03/22 23:54:16 by gwojda ### ########.fr # # # # **************************************************************************** # NAME = 42sh CC = gcc -FLAGS = -Wall -Wextra -Werror -fvisibility=hidden -fsanitize=address +FLAGS = -Wall -Wextra -Werror #-fvisibility=hidden -fsanitize=address D_FLAGS = -g DELTA = $$(echo "$$(tput cols)-47"|bc) diff --git a/42sh/src/completion/c_match_glob.c b/42sh/src/completion/c_match_glob.c index 016473cb..43d2cf9c 100644 --- a/42sh/src/completion/c_match_glob.c +++ b/42sh/src/completion/c_match_glob.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 17:20:01 by gwojda #+# #+# */ -/* Updated: 2017/03/22 14:51:44 by gwojda ### ########.fr */ +/* Updated: 2017/03/23 00:06:08 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -76,7 +76,7 @@ static int c_check_glob(char **ss_glob, char *current_word, str = data_singleton()->line.input; free(current_word); free(glob_echap); - if (!*ss_glob || !**ss_glob || + if (!ss_glob || !*ss_glob || !**ss_glob || !ft_strncmp(str + pos, *ss_glob, ft_strlen(*ss_glob))) { ft_sstrfree(ss_glob); diff --git a/42sh/src/line_editing/copy_cut_paste.c b/42sh/src/line_editing/copy_cut_paste.c index a562f968..37ba5f96 100644 --- a/42sh/src/line_editing/copy_cut_paste.c +++ b/42sh/src/line_editing/copy_cut_paste.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/19 12:45:06 by gwojda #+# #+# */ -/* Updated: 2017/03/22 23:19:57 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 23:53:57 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -31,7 +31,11 @@ int ft_x(char **str, size_t *pos) return (0); else if (ret == FLECHE_DROITE && !underline_right(str, pos, pos_ref)) return (0); - else + else if (ret == TOUCHE_HOME) + underline_home(str, pos, pos_ref); + else if (ret == TOUCHE_END) + underline_end(str, pos, pos_ref); + else if (ret != FLECHE_DROITE && ret != FLECHE_GAUCHE) break ; } if (data_singleton()->line.copy_tmp && *data_singleton()->line.copy_tmp)