summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.h5
-rw-r--r--src/search.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h
index 8e610f5..5255c1a 100644
--- a/src/config.h
+++ b/src/config.h
@@ -1,6 +1,11 @@
#pragma once
+#if defined(_WIN32)
+#define MAX_INPUT_LENGTH 32767
+#elif defined(__linux__)
#define MAX_INPUT_LENGTH 4096
+#endif
+
#define MAX_ERROR_MESSAGE_LENGTH (MAX_INPUT_LENGTH)
#define FILE_RESERVE_COUNT 1000
#define ERROR_RESERVE_COUNT 100
diff --git a/src/search.cpp b/src/search.cpp
index 8e7b8a1..ed6c1ee 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -88,7 +88,7 @@ ts_search_result *ts_create_empty_search_result()
new_result_buffer->file_count = 0;
new_result_buffer->cancel_search = false;
new_result_buffer->max_file_size = megabytes(1000);
- new_result_buffer->memory = ts_memory_bucket_init(megabytes(1));
+ new_result_buffer->memory = ts_memory_bucket_init(megabytes(10));
new_result_buffer->prev_result = current_search_result;
new_result_buffer->timestamp = ts_platform_get_time();
@@ -262,6 +262,7 @@ static void _ts_search_file(ts_found_file *ref, ts_file_content content, ts_sear
file_match.word_match_offset = m->word_offset;
file_match.word_match_length = m->word_match_len;
file_match.line_info = (char *)ts_memory_bucket_reserve(&result->memory, MAX_INPUT_LENGTH);
+ memset(file_match.line_info, 0, MAX_INPUT_LENGTH);
// Trim some text infront of match.
int text_pad_lr = 35;