Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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 src/host/os_writefile_ifnotequal.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int os_writefile_ifnotequal(lua_State* L)

if (!error)
{
lua_pushinteger(L, error ? -1 : 0);
lua_pushinteger(L, 1);
Comment thread
mercury233 marked this conversation as resolved.
return 1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/os/os.writefile_ifnotequal.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ok, err = os.writefile_ifnotequal("text", "filename")

### Return Value ###

True if successful, otherwise nil and an error message.
`1` if successful, `0` if the string is identical to the current file contents, otherwise `-1` and an error message.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest changing this to be a table

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`1` if successful, `0` if the string is identical to the current file contents, otherwise `-1` and an error message.
The first return value:
| Value | Explanation |
|-------|------------------------------------------------------|
| 1 | The string was written to the file |
| 0 | The string is identical to the current file contents |
| -1 | An error occurred |
The second return value is an error message if the first return value is -1, otherwise nil.

should it be like this?



### Availability ###
Expand Down
Loading