Skip to content

Commit

Permalink
Port /tg/ PR #75835 - Linux 515 fcopy() crash fix (#3525)
Browse files Browse the repository at this point in the history
  • Loading branch information
fira authored Jun 29, 2023
1 parent c3ffb3b commit ae54d1f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/_byond_version_compat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,15 @@
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif

#if (DM_VERSION == 515)
/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows
/// var case matches documentation for fcopy.
/world/proc/__fcopy(Src, Dst)
if (istext(Src) && !fexists(Src))
return 0
return fcopy(Src, Dst)

#define fcopy(Src, Dst) world.__fcopy(Src, Dst)

#endif

0 comments on commit ae54d1f

Please sign in to comment.