From cc691120dbec40a8d62fdcd7a30334401e7ce6f0 Mon Sep 17 00:00:00 2001 From: Adam JOLY Date: Sat, 9 Nov 2024 18:55:10 +0100 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix(Sed):=20Fi?= =?UTF-8?q?xed=20me=20not=20knowing=20how=20to=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ex04/sed.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ex04/sed.cpp b/ex04/sed.cpp index ca1a354..a23a5a9 100644 --- a/ex04/sed.cpp +++ b/ex04/sed.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/11/07 16:45:25 by adjoly #+# #+# */ -/* Updated: 2024/11/07 18:45:45 by adjoly ### ########.fr */ +/* Updated: 2024/11/09 18:49:49 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,7 @@ Sed::Sed(std::string &inFile, std::string &s1, std::string &s2): buf << infile.rdbuf(); _content = buf.str(); infile.close(); - pos = _content.find(s1, pos + s2.length()); + pos = _content.find(s1, pos); while (pos < _content.length()) { _content.erase(pos, s1.length());