Skip to content

Commit

Permalink
[release] fix mapper for empty headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Doroshenko committed Dec 5, 2022
1 parent 183957a commit f358f95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions IncludeToolboxShared/Util/ParseIncludes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static partial class Parser

public static IncludeLine[] ParseInclues(ReadOnlySpan<char> text, bool ignore_ifdefs = true)
{
if (text.IsEmpty) return new IncludeLine[0];
List<IncludeLine> lines = new();
Lexer.Context lctx = new(text);

Expand Down
1 change: 1 addition & 0 deletions IncludeToolboxShared/Util/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static ReadOnlySpan<char> GetIncludeSpanRO(string text)
{
int[] line = new int[2];
line[0] = text.IndexOf("#include"); //first
if (line[0] == -1) return new ReadOnlySpan<char>();
line[1] = text.IndexOf("\n", text.LastIndexOf("#include")) - line[0] + 1; //last
return text.AsSpan(line[0], line[1]);
}
Expand Down

0 comments on commit f358f95

Please sign in to comment.