1
0

🔨」 fix(Sed): Fixed me not knowing how to code

This commit is contained in:
2024-11-09 18:55:10 +01:00
parent daf3aa6c7d
commit cc691120db

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/07 16:45:25 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(); buf << infile.rdbuf();
_content = buf.str(); _content = buf.str();
infile.close(); infile.close();
pos = _content.find(s1, pos + s2.length()); pos = _content.find(s1, pos);
while (pos < _content.length()) while (pos < _content.length())
{ {
_content.erase(pos, s1.length()); _content.erase(pos, s1.length());