Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/platform_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ char *PlatformReadFile(Picoc *pc, const char *FileName)

if ((ReadText[0] == '#') && (ReadText[1] == '!'))
{
for (p = ReadText; (*p != '\r') && (*p != '\n'); ++p)
for (p = ReadText; (*p != '\0') && (*p != '\r') && (*p != '\n'); ++p)
{
*p = ' ';
}
Expand Down
1 change: 1 addition & 0 deletions tests/69_shebang_script.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!
Empty file added tests/69_shebang_script.expect
Empty file.
4 changes: 4 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ TESTS= 00_assignment.test \
66_printf_undefined.test \
67_macro_crash.test \
68_return.test \
69_shebang_script.test \


include csmith/Makefile
Expand All @@ -71,6 +72,9 @@ include csmith/Makefile
@if [ "x`echo $* | grep args`" != "x" ]; \
then \
../picoc $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \
elif [ "x`echo $* | grep script`" != "x" ]; \
then \
../picoc -s $*.c 2>&1 >$*.output; \
else \
../picoc $*.c 2>&1 >$*.output; \
fi
Expand Down