Commit 1942e64d by Mathijs van de Nes Committed by Victor M. Alvarez

Display line number even if filename is unknown (#31)

When rules are passed as strings, the line number would not be shown
when input as a string. The information is available however.
parent b26fe50e
...@@ -1650,7 +1650,8 @@ void raise_exception_on_error( ...@@ -1650,7 +1650,8 @@ void raise_exception_on_error(
else else
PyErr_Format( PyErr_Format(
YaraSyntaxError, YaraSyntaxError,
"%s", "line %d: %s",
line_number,
message); message);
} }
} }
...@@ -1675,7 +1676,8 @@ void raise_exception_on_error_or_warning( ...@@ -1675,7 +1676,8 @@ void raise_exception_on_error_or_warning(
else else
PyErr_Format( PyErr_Format(
YaraSyntaxError, YaraSyntaxError,
"%s", "line %d: %s",
line_number,
message); message);
} }
else else
...@@ -1690,7 +1692,8 @@ void raise_exception_on_error_or_warning( ...@@ -1690,7 +1692,8 @@ void raise_exception_on_error_or_warning(
else else
PyErr_Format( PyErr_Format(
YaraWarningError, YaraWarningError,
"%s", "line %d: %s",
line_number,
message); message);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment