Added Nikolaus Klepp's shebang patch

git-svn-id: http://picoc.googlecode.com/svn/trunk@574 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2012-08-28 10:26:12 +00:00
parent f37ea8c96d
commit 0789a4c719

View file

@ -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);
}