Skip to content

Commit

Permalink
Added Nikolaus Klepp's shebang patch
Browse files Browse the repository at this point in the history
  • Loading branch information
zik.saleeba committed Aug 28, 2012
1 parent d9a3edc commit f16f2e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions platform/platform_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ void PicocPlatformScanFile(const char *FileName)
{
char *SourceStr = PlatformReadFile(FileName);

/* ignore "#!/path/to/picoc" .. by replacing the "#!" with "//" */
if (SourceStr != NULL && SourceStr[0] == '#' && SourceStr[1] == '!')
{
SourceStr[0] = '/';
SourceStr[1] = '/';
}

PicocParse(FileName, SourceStr, strlen(SourceStr), TRUE, FALSE, TRUE, TRUE);
}

Expand Down

0 comments on commit f16f2e4

Please sign in to comment.