diff --git a/gitleaks-original-encoded-secrets b/gitleaks-original-encoded-secrets index b25c382..02d2702 100755 --- a/gitleaks-original-encoded-secrets +++ b/gitleaks-original-encoded-secrets @@ -22,11 +22,10 @@ def extract( li_start = start_line - 1 li_end = end_line - 1 - col_start = start_column - 1 - col_end = end_column + col_start = start_column - 2 + col_end = end_column - 1 if start_line - end_line > 0 else end_column - 1 - col_start - # keep the ends to preserve the original string content - lines = file_content.splitlines(keepends=True) + lines = file_content.splitlines() # scope lines lines = [line for li, line in enumerate(lines) if li_start <= li <= li_end]