Skip to content

Commit

Permalink
Fix Issue 13512 - Allow non-UTF-8 encoding in shebang line
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketmar Dark authored and CyberShadow committed Jul 2, 2017
1 parent d7887fb commit 9f50d03
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/ddmd/lexer.d
Expand Up @@ -191,28 +191,16 @@ class Lexer
p += 2;
while (1)
{
char c = *p;
char c = *p++;
switch (c)
{
case '\n':
p++;
break;
case '\r':
p++;
if (*p == '\n')
p++;
break;
case 0:
case 0x1A:
p--;
goto case;
case '\n':
break;
default:
if (c & 0x80)
{
uint u = decodeUTF();
if (u == PS || u == LS)
break;
}
p++;
continue;
}
break;
Expand Down

0 comments on commit 9f50d03

Please sign in to comment.