From 385b5c002a83d4683d29d9d4f306d929e1ad1e41 Mon Sep 17 00:00:00 2001
From: JozanLeClerc <bousset.rudy@gmail.com>
Date: Fri, 4 Sep 2020 22:24:49 +0200
Subject: gotta do stuff

---
 src/p_args.c        |  7 +++----
 src/p_args_escape.c | 30 ++++++++++++++++++++++++++++++
 src/p_args_escape.h | 18 ++++++++++++++++++
 src/p_args_quotes.c |  3 ++-
 4 files changed, 53 insertions(+), 5 deletions(-)
 create mode 100644 src/p_args_escape.c
 create mode 100644 src/p_args_escape.h

(limited to 'src')

diff --git a/src/p_args.c b/src/p_args.c
index c25fc40..9ce0230 100644
--- a/src/p_args.c
+++ b/src/p_args.c
@@ -17,6 +17,7 @@
 #include "d_define.h"
 #include "p_args.h"
 #include "p_args_next.h"
+#include "p_args_escape.h"
 #include "p_args_quotes.h"
 
 /* ================= */
@@ -139,9 +140,9 @@ static char
 		p_del_alloced_words(words, to_del);
 		return (NULL);
 	}
-	p_print(words);
-	p_escape_chars(words);
+	p_args_escape_chars(words);
 	p_args_quotes(words);
+	p_print(words);
 	return (words);
 }
 
@@ -156,11 +157,9 @@ char
 	{
 		if ((words = p_split_words_no_rdr(word)) == NULL)
 			return (NULL);
-		p_print(words);
 		exit(0);
 		return (words);
 	}
-	p_print(words);
 	return (words);
 	/* char	**words; */
 	/* char	*subst; */
diff --git a/src/p_args_escape.c b/src/p_args_escape.c
new file mode 100644
index 0000000..e6c9a24
--- /dev/null
+++ b/src/p_args_escape.c
@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   p_args_escape.c                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: rbousset <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2020/02/14 17:19:27 by rbousset          #+#    #+#             */
+/*   Updated: 2020/02/14 17:19:29 by rbousset         ###   ########lyon.fr   */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include <stddef.h>
+
+void
+	p_args_escape_chars(char *words[])
+{
+	/* TODO: escape \ */
+	/* TODO: escape $vars */
+	/* TODO: escape $# special vars */
+	/* TODO: escape my life */
+	char	**ptr;
+
+	ptr = words;
+	while (*ptr != NULL)
+	{
+		/* if (**ptr != C_SQUOTE) */
+		ptr++;
+	}
+}
diff --git a/src/p_args_escape.h b/src/p_args_escape.h
new file mode 100644
index 0000000..1b6926c
--- /dev/null
+++ b/src/p_args_escape.h
@@ -0,0 +1,18 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   p_args_escape.h                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: rbousset <marvin@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2020/02/14 17:19:27 by rbousset          #+#    #+#             */
+/*   Updated: 2020/02/14 17:19:29 by rbousset         ###   ########lyon.fr   */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef P_ARGS_ESCAPE_H
+#define P_ARGS_ESCAPE_H
+
+void	p_args_escape_chars(char *words[]);
+
+#endif
diff --git a/src/p_args_quotes.c b/src/p_args_quotes.c
index d0ade4f..24d39e7 100644
--- a/src/p_args_quotes.c
+++ b/src/p_args_quotes.c
@@ -45,9 +45,10 @@ static void
 			ft_memmove(word + (ptr - word), ptr + 1, ft_strlen(ptr + 1) + 1);
 		}
 	}
-	/* TODO: subst various dquotes chars */
 }
 
+WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRROOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
+
 void
 	p_args_quotes(char *words[])
 {
-- 
cgit v1.2.3