From 7f0bf3c448f1b3d7439562572c9f25d831c5d99e Mon Sep 17 00:00:00 2001
From: Florian Fischer <florian.fischer@muhq.space>
Date: Tue, 12 Oct 2021 14:05:16 +0200
Subject: [PATCH] [fsearch] remove obsolete offset tracking code

---
 apps/fsearch/fsearch.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/apps/fsearch/fsearch.cpp b/apps/fsearch/fsearch.cpp
index 73c0c40e..1d3ac9c1 100644
--- a/apps/fsearch/fsearch.cpp
+++ b/apps/fsearch/fsearch.cpp
@@ -37,9 +37,8 @@ void search(const std::string& path) {
 	}
 
 	std::array<char, EMPER_RIPGREP_BUFSIZE> buf;
-	off_t bytes_searched = 0;
 
-	ssize_t bytes_read = emper::io::readFileAndWait(fd, buf.data(), buf.size(), bytes_searched);
+	ssize_t bytes_read = emper::io::readFileAndWait(fd, buf.data(), buf.size(), 0);
 	while (bytes_read > 0) {
 		if (memmem(&buf[0], bytes_read, needle, needle_len)) {
 			std::array<char, PATH_MAX + 1> outBuf;
@@ -49,7 +48,6 @@ void search(const std::string& path) {
 			goto out;
 		}
 
-		bytes_searched += bytes_read;
 		bytes_read = emper::io::readFileAndWait(fd, buf.data(), buf.size(), -1);
 	}
 
-- 
GitLab