Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
atilaneves committed Apr 18, 2024
1 parent d63f904 commit cb89129
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/dub/internal/utils.d
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ string getModuleNameFromContent(string content) {
// block comment?
else if(ch == '*') {
++i;
while(ch != '*' && content[i + 1] != '/')
while(ch != '*' || content[i + 1] != '/')
++i;
++i; // skip over closing '/'
}
Expand Down Expand Up @@ -728,6 +728,8 @@ unittest {
assert(getModuleNameFromContent("/++ ++/\nmodule foo;") == "foo");
assert(getModuleNameFromContent("module pokémon;") == "pokémon");
assert(getModuleNameFromContent("module éclair;") == "éclair");
assert(getModuleNameFromContent("/** module foo*/ module bar;") == "bar");
assert(getModuleNameFromContent("/* / module foo*/ module bar;") == "bar");
}

/**
Expand Down

0 comments on commit cb89129

Please sign in to comment.